home *** CD-ROM | disk | FTP | other *** search
/ Champak 66 / Vol 66.iso / games / abstract.swf / scripts / frame_10 / DoAction.as
Text File  |  2013-04-24  |  148KB  |  5,180 lines

  1. stop();
  2. var cr = new Array();
  3. var crc = 0;
  4. var pc = new Array();
  5. var lig = new Array();
  6. var ef = new Array();
  7. var cr_queue = new Array();
  8. var playerScore = 0;
  9. var hiscorePerSecond = 0;
  10. var playerLives = 5;
  11. var baseSpeed = 1;
  12. var baseSpeedStr = "00.00";
  13. var textSpeed = 1;
  14. var crystalspeed = 1;
  15. var minSpawnCrystalChance = 5;
  16. var spawnCrystalChance = 5;
  17. var rE = 578;
  18. var lE = 22;
  19. var tE = 22;
  20. var bE = 424;
  21. var gamePaused = false;
  22. var gameStartTime = getTimer();
  23. var pauseTime = 0;
  24. var gameThen = getTimer();
  25. var timestring = "00:00:00";
  26. var magnetismActive = false;
  27. var magnetismActiveTime = 0;
  28. var netActive = false;
  29. var netActiveTime = 0;
  30. var shieldActive = false;
  31. var shieldActiveTime = 0;
  32. var wavyMotionActive = false;
  33. var wavyMotionTime = 0;
  34. var shakyMotionActive = false;
  35. var shakyMotionTime = 0;
  36. var rotationActive = false;
  37. var rotationTime = 0;
  38. var nonUniformDropSpeedActive = false;
  39. var nonUniformDropSpeedTime = 0;
  40. var pacmanActive = false;
  41. var pacmanTime = 0;
  42. var matrixActive = false;
  43. var matrixTime = 0;
  44. var tetrisActive = false;
  45. var tetrisTime = 0;
  46. var symmetryActive = false;
  47. var symmetryTime = 0;
  48. var symmetrySwitch = false;
  49. var snakeActive = false;
  50. var snakeTime = 0;
  51. var planesActive = false;
  52. var planesTime = 0;
  53. var robotsActive = false;
  54. var robotsTime = 0;
  55. var tunnelActive = false;
  56. var tunnelTime = 0;
  57. var arkanoidActive = false;
  58. var arkanoidTime = 0;
  59. var bossOneActive = false;
  60. var bossTwoActive = false;
  61. var bossThreeActive = false;
  62. var bossFourActive = false;
  63. var thingMinWidth = 17;
  64. var levelInterval = 0;
  65. var clockInterval = 0;
  66. var speedStrInterval = 0;
  67. var hours = 0;
  68. var minutes = 0;
  69. var seconds = 0;
  70. var tuteBox = 0;
  71. var tuteBoxOn = false;
  72. var k = 0;
  73. var keyListener = new Object();
  74. var hours = 0;
  75. var minutes = 0;
  76. var seconds = 0;
  77. var sq = Math.sqrt;
  78. var po = Math.pow;
  79. var ab = Math.abs;
  80. var ro = Math.round;
  81. var sin = Math.sin;
  82. var cos = Math.cos;
  83. var powerUpsEnabled = 0;
  84. var speedUpFast = true;
  85. var kongr_bossOneKilled = false;
  86. var kongr_bossTwoKilled = false;
  87. var kongr_bossThreeKilled = false;
  88. var kongr_bossFourKilled = false;
  89. var pp = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24];
  90. var poC = 0;
  91. updateScoresOnKongregate = function()
  92. {
  93.    if(!_root.freePlayActive)
  94.    {
  95.       _root.kongregateStats.submit("points",_root.playerScore);
  96.       _root.kongregateStats.submit("boss1",_root.kongr_bossOneKilled != true ? 0 : 1);
  97.       _root.kongregateStats.submit("boss2",_root.kongr_bossTwoKilled != true ? 0 : 1);
  98.       _root.kongregateStats.submit("boss3",_root.kongr_bossThreeKilled != true ? 0 : 1);
  99.       _root.kongregateStats.submit("boss4",_root.kongr_bossFourKilled != true ? 0 : 1);
  100.    }
  101. };
  102. shuffleResetAr = function()
  103. {
  104.    var _loc2_ = 0;
  105.    while(_loc2_ < 200)
  106.    {
  107.       var _loc4_ = random(25);
  108.       var _loc3_ = random(25);
  109.       var _loc5_ = _root.pp[_loc4_];
  110.       _root.pp[_loc4_] = _root.pp[_loc3_];
  111.       _root.pp[_loc3_] = _loc5_;
  112.       _loc2_ = _loc2_ + 1;
  113.    }
  114. };
  115. getOpenPos = function()
  116. {
  117.    var _loc2_ = 33 + 22 * _root.pp[_root.poC];
  118.    _root.poC = _root.poC + 1;
  119.    if(_root.poC >= 24)
  120.    {
  121.       _root.shuffleResetAr();
  122.       _root.poC = 0;
  123.    }
  124.    return _loc2_;
  125. };
  126. initPausedScreenFunctionsCamp = function()
  127. {
  128.    _root.gamePausedScreenCampaign.yea1.newGameButton.onRollOver = _root.gamePausedScreenCampaign.yea1.helpButton.onRollOver = _root.gamePausedScreenCampaign.yea1.creditsButton.onRollOver = _root.gamePausedScreenCampaign.yea1.optionsButton.onRollOver = _root.gamePausedScreenCampaign.yea1.resumeButton.onRollOver = function()
  129.    {
  130.       _root.playSFX("menuRollOver");
  131.       this.filters = [new flash.filters.GlowFilter(12303359,1,6,6,2,3,false,false)];
  132.    };
  133.    _root.gamePausedScreenCampaign.yea1.newGameButton.onRollOut = _root.gamePausedScreenCampaign.yea1.helpButton.onRollOut = _root.gamePausedScreenCampaign.yea1.creditsButton.onRollOut = _root.gamePausedScreenCampaign.yea1.optionsButton.onRollOut = _root.gamePausedScreenCampaign.yea1.resumeButton.onRollOut = _root.gamePausedScreenCampaign.yea1.newGameButton.onReleaseOutside = _root.gamePausedScreenCampaign.yea1.helpButton.onReleaseOutside = _root.gamePausedScreenCampaign.yea1.optionsButton.onReleaseOutside = _root.gamePausedScreenCampaign.yea1.creditsButton.onReleaseOutside = _root.gamePausedScreenCampaign.yea1.resumeButton.onReleaseOutside = function()
  134.    {
  135.       this.filters = [];
  136.    };
  137.    _root.gamePausedScreenCampaign.yea1.newGameButton.onRelease = function()
  138.    {
  139.       _root.gamePausedScreenCampaign._x = -475;
  140.       delete _root.frame.update;
  141.       _root.gotoAndStop("gameOver");
  142.    };
  143.    _root.gamePausedScreenCampaign.yea1.helpButton.onRelease = function()
  144.    {
  145.       _root.gamePausedScreenCampaign._x = -475;
  146.       _root.helpScreen._x = 300;
  147.       _root.helpScreen._y = 225;
  148.       _root.helpScreen._alpha = 80;
  149.       _root.helpScreen.swapDepths(_root.getNextHighestDepth());
  150.    };
  151.    _root.gamePausedScreenCampaign.yea1.optionsButton.onRelease = function()
  152.    {
  153.       _root.gamePausedScreenCampaign._x = -475;
  154.       _root.optionsScreen._x = 300;
  155.       _root.optionsScreen._y = 250;
  156.       _root.optionsScreen._alpha = 80;
  157.       _root.optionsScreen.swapDepths(_root.getNextHighestDepth());
  158.    };
  159.    _root.gamePausedScreenCampaign.yea1.creditsButton.onRelease = function()
  160.    {
  161.       _root.gamePausedScreenCampaign._x = -475;
  162.       _root.creditsScreen._x = 300;
  163.       _root.creditsScreen._y = 250;
  164.       _root.creditsScreen.filters = [new flash.filters.GlowFilter(16777215,1,10,10,3,3,false,false)];
  165.       _root.creditsScreen._alpha = 80;
  166.       _root.creditsScreen.swapDepths(_root.getNextHighestDepth());
  167.    };
  168.    _root.gamePausedScreenCampaign.yea1.resumeButton.onRelease = function()
  169.    {
  170.       _root.toggleMainMenuButtons(false);
  171.       _root.gamePausedScreenCampaign._x = -475;
  172.       _root.gamePaused = false;
  173.       Mouse.hide();
  174.    };
  175. };
  176. makePausedScreen = function()
  177. {
  178.    if(_root.gamePausedScreenCampaign == undefined)
  179.    {
  180.       var _loc2_ = _root.createEmptyMovieClip("gamePausedScreenCampaign",_root.getNextHighestDepth());
  181.       _loc2_.attachMovie("gamePausedScreenCampaign","yea1",_loc2_.getNextHighestDepth());
  182.       _loc2_._x = -475;
  183.       _loc2_._y = 250;
  184.       _loc2_._alpha = 80;
  185.       _root.initPausedScreenFunctionsCamp();
  186.    }
  187. };
  188. toggleSFX = function(st)
  189. {
  190.    if(!st)
  191.    {
  192.       _root.sfx.stop();
  193.    }
  194. };
  195. toggleMusic = function(st)
  196. {
  197.    if(st)
  198.    {
  199.       if(_root.bossOneActive)
  200.       {
  201.          _root.playMusic("lovebirds",9999,false);
  202.       }
  203.       else if(_root.bossTwoActive)
  204.       {
  205.          _root.playMusic("attack",999,false);
  206.       }
  207.       else if(_root.bossThreeActive)
  208.       {
  209.          _root.playMusic("snap",999,false);
  210.       }
  211.       else if(_root.bossFourActive)
  212.       {
  213.          _root.playMusic("dreamonmarco",999,false);
  214.       }
  215.       else
  216.       {
  217.          _root.playCurrentTrack();
  218.       }
  219.    }
  220.    else
  221.    {
  222.       _root.music.stop();
  223.    }
  224. };
  225. playPowerupSound = function()
  226. {
  227.    _root.playSFX("powerupshort" + (1 + random(3)));
  228. };
  229. df = function(nu, tr)
  230. {
  231.    var _loc2_ = _root.po(10,tr);
  232.    var _loc3_ = _root.ro(nu * _loc2_) / _loc2_;
  233.    return _loc3_;
  234. };
  235. updateDesiredSpeed = function(mo)
  236. {
  237.    _root.desiredSpeed += mo;
  238.    if(_root.desiredSpeed < _root.levelMinSpeed)
  239.    {
  240.       _root.desiredSpeed = _root.levelMinSpeed;
  241.    }
  242.    if(_root.desiredSpeed > _root.levelMaxSpeed)
  243.    {
  244.       _root.desiredSpeed = _root.levelMaxSpeed;
  245.    }
  246.    if(_root.desiredSpeed < _root.MIN_SPEED)
  247.    {
  248.       _root.desiredSpeed = _root.MIN_SPEED;
  249.    }
  250.    if(_root.desiredSpeed > _root.MAX_SPEED)
  251.    {
  252.       _root.desiredSpeed = _root.MAX_SPEED;
  253.    }
  254. };
  255. updateSpeed = function()
  256. {
  257.    var _loc3_ = 120;
  258.    var _loc2_ = 12;
  259.    if(!_root.speedUpFast)
  260.    {
  261.       _loc3_ = 12;
  262.       _loc2_ = 120;
  263.    }
  264.    if(_root.desiredSpeed > _root.levelSpeed)
  265.    {
  266.       _root.desiredSpeed -= (_root.desiredSpeed - _root.levelSpeed) / _loc3_;
  267.    }
  268.    else if(_root.desiredSpeed < _root.levelSpeed)
  269.    {
  270.       _root.desiredSpeed += (_root.levelSpeed - _root.desiredSpeed) / _loc2_;
  271.    }
  272.    if(_root.baseSpeed > _root.desiredSpeed)
  273.    {
  274.       _root.baseSpeed -= (_root.baseSpeed - _root.desiredSpeed) / _loc3_;
  275.    }
  276.    else if(_root.baseSpeed < _root.desiredSpeed)
  277.    {
  278.       _root.baseSpeed += (_root.desiredSpeed - _root.baseSpeed) / _loc2_;
  279.    }
  280. };
  281. thingCopyUpdate = function()
  282. {
  283.    this.thing.shield._visible = _root.shieldActive;
  284.    this.thing.pacman._visible = _root.pacmanActive;
  285.    this.thing.blueThing._visible = _root.thing.blueThing._visible;
  286.    var _loc5_ = getTimer();
  287.    var _loc4_ = _loc5_ - this.then;
  288.    this.then = _loc5_;
  289.    if(_root.snakeActive)
  290.    {
  291.       this.thing.snakeSkin._visible = true;
  292.       var _loc3_ = 2 * (_loc4_ / 30);
  293.       this._width *= 0.98;
  294.    }
  295.    else
  296.    {
  297.       this.thing.snakeSkin._visible = false;
  298.       _loc3_ = 4 * (_loc4_ / 30);
  299.       this._width *= 0.95;
  300.    }
  301.    if(_loc3_ > 20)
  302.    {
  303.       _loc3_ = 20;
  304.    }
  305.    this._y += _loc3_;
  306.    this._height = this._width;
  307.    this._alpha -= _loc3_;
  308.    if(this._alpha <= 0)
  309.    {
  310.       this.remove = true;
  311.    }
  312. };
  313. makeThingCopy = function(xx, yy, ww)
  314. {
  315.    _root.crc = _root.crc + 1;
  316.    var _loc2_ = _root.createEmptyMovieClip("tc" + _root.crc,_root.getNextHighestDepth());
  317.    var _loc3_ = _loc2_.attachMovie("thingWSnake","thing",_loc2_.getNextHighestDepth());
  318.    _loc2_.thing.shield._visible = _root.thing.shield._visible;
  319.    _loc2_.thing.pacman._visible = _root.thing.pacman._visible;
  320.    _loc2_.thing.blueThing._visible = _root.thing.blueThing._visible;
  321.    _loc2_.thing.snakeSkin._visible = _root.snakeActive;
  322.    _loc2_._x = xx;
  323.    _loc2_._y = yy;
  324.    if(_root.snakeActive)
  325.    {
  326.       _loc2_._y += 10;
  327.    }
  328.    _loc2_.cpy = true;
  329.    _loc2_._alpha = 50;
  330.    _loc2_._width = _loc2_._height = ww - 2;
  331.    _loc2_.then = getTimer();
  332.    _loc2_.update = _root.thingCopyUpdate;
  333.    _loc2_.swapDepths(_root.thing);
  334.    _root.ef.push(_loc2_);
  335. };
  336. thingUpdate = function()
  337. {
  338.    var _loc5_ = this._width - this.desiredWidth;
  339.    this._width -= _loc5_ / 24;
  340.    this._height -= _loc5_ / 24;
  341.    var _loc7_ = this._x - _xmouse;
  342.    var _loc8_ = this._y - _ymouse;
  343.    var _loc4_ = (18 - _root.baseSpeed) * 0.3529 + 2;
  344.    this._x -= _loc7_ / _loc4_;
  345.    this._y -= _loc8_ / _loc4_;
  346.    var _loc6_ = getTimer();
  347.    var _loc3_ = _loc6_ - this.then;
  348.    this.then = _loc6_;
  349.    if(_loc3_ > 100)
  350.    {
  351.       _loc3_ = 10;
  352.    }
  353.    else
  354.    {
  355.       this.shrink += _loc3_;
  356.       if(this.shrink > 1000)
  357.       {
  358.          this.shrink = 0;
  359.          if(this._width > _root.thingMinWidth)
  360.          {
  361.             this.desiredWidth *= 0.95;
  362.          }
  363.       }
  364.    }
  365.    _root.makeThingCopy(this._x,this._y,this._width);
  366.    if(this._x + this._width / 2 > _root.rE)
  367.    {
  368.       this._x = _root.rE - this._width / 2;
  369.    }
  370.    else if(this._x - this._width / 2 < _root.lE)
  371.    {
  372.       this._x = _root.lE + this._width / 2;
  373.    }
  374.    if(this._y + this._height / 2 > _root.bE)
  375.    {
  376.       this._y = _root.bE - this._height / 2;
  377.    }
  378.    else if(this._y < _root.tE + this._height / 2)
  379.    {
  380.       this._y = _root.tE + this._height / 2;
  381.    }
  382. };
  383. thingShotUpdate = function()
  384. {
  385.    var _loc5_ = getTimer();
  386.    var _loc4_ = _loc5_ - this.then;
  387.    if(_loc4_ > 100)
  388.    {
  389.       _loc4_ = 10;
  390.    }
  391.    this.then = _loc5_;
  392.    this._y -= 10 * _loc4_ / 30;
  393.    if(this._y < -20)
  394.    {
  395.       this.remove = true;
  396.    }
  397.    for(var _loc3_ in _root.cr)
  398.    {
  399.       if(_root.cr[_loc3_].fighter == true)
  400.       {
  401.          if(_root.cr[_loc3_].hitTest(this._x,this._y - 15,true))
  402.          {
  403.             this.remove = true;
  404.             _root.cr[_loc3_].hitpoints--;
  405.          }
  406.       }
  407.    }
  408. };
  409. makeThingShot = function(xx, yy, ww)
  410. {
  411.    var _loc2_ = _root.createEmptyMovieClip("ps" + _root.crc,_root.getNextHighestDepth());
  412.    var _loc3_ = _loc2_.attachMovie("thingShot","ps",_loc2_.getNextHighestDepth());
  413.    _loc2_._x = xx;
  414.    _loc2_._y = yy;
  415.    _loc2_.cpy = true;
  416.    _loc2_.then = getTimer();
  417.    _loc2_.update = _root.thingShotUpdate;
  418.    _root.ef.push(_loc2_);
  419. };
  420. thingAlternativeUpdate = function()
  421. {
  422.    var _loc5_ = this._x - _xmouse;
  423.    var _loc6_ = this._y - _ymouse;
  424.    var _loc3_ = (18 - _root.baseSpeed) * 0.3529 + 2;
  425.    this._x -= _loc5_ / _loc3_;
  426.    this._y -= _loc6_ / _loc3_;
  427.    var _loc4_ = getTimer();
  428.    var _loc7_ = _loc4_ - this.then;
  429.    if(_loc7_ > 80)
  430.    {
  431.       _root.makeThingShot(this._x,this._y,this._width);
  432.       this.then = _loc4_;
  433.    }
  434.    if(this._x + this._width / 2 > _root.rE)
  435.    {
  436.       this._x = _root.rE - this._width / 2;
  437.    }
  438.    else if(this._x - this._width / 2 < _root.lE)
  439.    {
  440.       this._x = _root.lE + this._width / 2;
  441.    }
  442.    if(this._y + this._height / 2 > _root.bE)
  443.    {
  444.       this._y = _root.bE - this._height / 2;
  445.    }
  446.    else if(this._y < _root.tE + this._height / 2)
  447.    {
  448.       this._y = _root.tE + this._height / 2;
  449.    }
  450. };
  451. frame.update = function()
  452. {
  453.    this.swapDepths(_root.getNextHighestDepth() - 1);
  454. };
  455. showSpark = function(x, y)
  456. {
  457.    _root.crc = _root.crc + 1;
  458.    var _loc4_ = undefined;
  459.    if(random(10) % 2 == 0)
  460.    {
  461.       _loc4_ = "spark2";
  462.    }
  463.    else
  464.    {
  465.       _loc4_ = "spark3";
  466.    }
  467.    var _loc3_ = this.attachMovie("" + _loc4_,"sp" + _root.crc,this.getNextHighestDepth());
  468.    _loc3_._x = x;
  469.    _loc3_._y = y;
  470.    _loc3_._alpha = 20;
  471.    _loc3_._xscale = 50 + random(100);
  472.    _loc3_._yscale = _loc3_._xscale;
  473.    _loc3_.update = function()
  474.    {
  475.       this._alpha -= 0.1;
  476.       if(this._alpha <= 0)
  477.       {
  478.          this.remove = true;
  479.       }
  480.    };
  481.    _root.ef.push(_loc3_);
  482. };
  483. showSmallSign = function(s)
  484. {
  485.    _root.playSFX("message");
  486.    _root.crc = _root.crc + 1;
  487.    var _loc5_ = _root.createEmptyMovieClip("aSmallSign" + _root.crc,_root.getNextHighestDepth());
  488.    var _loc3_ = _loc5_.createTextField("b",_loc5_.getNextHighestDepth(),450,400,200,50);
  489.    var _loc4_ = new TextFormat();
  490.    _loc4_.color = 16777215;
  491.    _loc4_.size = 16;
  492.    _loc4_.font = "MagistralC-Bold";
  493.    if(_root.planesActive)
  494.    {
  495.       _loc4_.color = 0;
  496.    }
  497.    _loc3_.selectable = false;
  498.    _loc3_.multiline = true;
  499.    _loc3_.wordWrap = true;
  500.    _loc3_.autoSize = true;
  501.    _loc4_.align = "center";
  502.    _loc3_.text = "" + s;
  503.    _loc3_.antiAliasType = "advanced";
  504.    _loc3_.embedFonts = true;
  505.    _loc3_.setTextFormat(_loc4_);
  506.    _loc3_._x = 450 - _loc3_._width / 2;
  507.    _loc3_._y = 400 - _loc3_._height / 2;
  508.    _loc5_.update = function()
  509.    {
  510.       this._y -= _root.textSpeed / 20;
  511.       this._alpha -= 0.1;
  512.       if(this._alpha <= 0)
  513.       {
  514.          this.remove = true;
  515.       }
  516.    };
  517.    _root.ef.push(_loc5_);
  518. };
  519. showBigSign = function(s, bossFour)
  520. {
  521.    _root.playSFX("message");
  522.    _root.crc = _root.crc + 1;
  523.    var _loc5_ = _root.createEmptyMovieClip("aSign" + _root.crc,_root.getNextHighestDepth());
  524.    var _loc3_ = _loc5_.createTextField("b",_loc5_.getNextHighestDepth(),300,200,400,50);
  525.    var _loc4_ = new TextFormat();
  526.    _loc4_.color = 16777215;
  527.    _loc4_.size = 26;
  528.    _loc4_.font = "MagistralC-Bold";
  529.    if(_root.planesActive)
  530.    {
  531.       _loc4_.color = 0;
  532.    }
  533.    _loc3_.selectable = false;
  534.    _loc3_.multiline = true;
  535.    _loc3_.wordWrap = true;
  536.    _loc3_.autoSize = true;
  537.    _loc4_.align = "center";
  538.    _loc3_.text = "" + s;
  539.    _loc3_.antiAliasType = "advanced";
  540.    _loc3_.embedFonts = true;
  541.    _loc3_.setTextFormat(_loc4_);
  542.    _loc3_._x = 300 - _loc3_._width / 2;
  543.    _loc3_._y = 200 - _loc3_._height / 2;
  544.    _loc5_.bossFour = bossFour;
  545.    _loc5_.update = function()
  546.    {
  547.       this._y -= _root.textSpeed / 20;
  548.       this._alpha -= 0.1;
  549.       if(this._alpha <= 0)
  550.       {
  551.          this.remove = true;
  552.          if(this.bossFour == true)
  553.          {
  554.             _root.onEnterFrame = _root.main;
  555.          }
  556.       }
  557.    };
  558.    _root.ef.push(_loc5_);
  559. };
  560. showText = function(s, x, y)
  561. {
  562.    _root.crc = _root.crc + 1;
  563.    var _loc5_ = _root.createEmptyMovieClip("aText" + _root.crc,_root.getNextHighestDepth());
  564.    var _loc3_ = _loc5_.createTextField("b",_loc5_.getNextHighestDepth(),x,y,100,40);
  565.    var _loc4_ = new TextFormat();
  566.    _loc4_.color = 15663069;
  567.    _loc4_.size = 12;
  568.    _loc4_.font = "MagistralC-Bold";
  569.    _loc3_.selectable = false;
  570.    _loc3_.autoSize = true;
  571.    _loc3_.text = "" + s;
  572.    _loc3_.antiAliasType = "advanced";
  573.    _loc3_.embedFonts = true;
  574.    _loc3_.setTextFormat(_loc4_);
  575.    _loc3_._x -= _loc3_._width / 2;
  576.    if(_loc3_._x + _loc3_._width > _root.rE)
  577.    {
  578.       _loc3_._x = _root.rE - _loc3_._width;
  579.    }
  580.    _loc5_.update = function()
  581.    {
  582.       this._y -= _root.textSpeed;
  583.       this._alpha -= 2;
  584.       if(this._alpha <= 0)
  585.       {
  586.          this.remove = true;
  587.       }
  588.    };
  589.    _root.ef.push(_loc5_);
  590. };
  591. showScore = function(sc, x, y)
  592. {
  593.    sc *= _root.baseSpeed;
  594.    var _loc5_ = 1;
  595.    if(_root.shakyMotionActive)
  596.    {
  597.       _loc5_ += 0.1;
  598.    }
  599.    if(_root.wavyMotionActive)
  600.    {
  601.       _loc5_ += 0.2;
  602.    }
  603.    if(_root.rotationActive)
  604.    {
  605.       _loc5_ += 0.1;
  606.    }
  607.    if(_root.speedChaosActive)
  608.    {
  609.       _loc5_ += 0.2;
  610.    }
  611.    if(_root.symmetryActive)
  612.    {
  613.       _loc5_ += 0.5;
  614.    }
  615.    sc *= _loc5_;
  616.    sc = _root.ro(sc / 10);
  617.    _root.playerScore += sc;
  618.    if(_root.playerScore < 0)
  619.    {
  620.       _root.playerScore = 0;
  621.    }
  622.    _root.crc = _root.crc + 1;
  623.    var _loc6_ = _root.createEmptyMovieClip("aScore" + _root.crc,_root.getNextHighestDepth());
  624.    var _loc3_ = _loc6_.createTextField("b",_loc6_.getNextHighestDepth(),x,y,100,40);
  625.    var _loc4_ = new TextFormat();
  626.    if(sc > 0)
  627.    {
  628.       _loc4_.color = 15663069;
  629.    }
  630.    else
  631.    {
  632.       _loc4_.color = 16755370;
  633.    }
  634.    if(_root.planesActive)
  635.    {
  636.       _loc4_.color = 0;
  637.    }
  638.    _loc4_.size = 12;
  639.    _loc4_.font = "MagistralC-Bold";
  640.    _loc3_.text = "" + sc;
  641.    _loc3_.selectable = false;
  642.    _loc3_.autoSize = true;
  643.    _loc3_.antiAliasType = "advanced";
  644.    _loc3_.embedFonts = true;
  645.    _loc3_.setTextFormat(_loc4_);
  646.    _loc3_._x -= _loc3_._width / 2;
  647.    if(_loc3_._x + _loc3_._width > _root.rE)
  648.    {
  649.       _loc3_._x = _root.rE - _loc3_._width;
  650.    }
  651.    if(!_root.planesActive)
  652.    {
  653.       _loc6_.update = function()
  654.       {
  655.          this._y -= _root.textSpeed;
  656.          this._alpha -= 1;
  657.          if(this._alpha <= 0)
  658.          {
  659.             this.remove = true;
  660.          }
  661.       };
  662.    }
  663.    else
  664.    {
  665.       _loc6_.update = function()
  666.       {
  667.          this._y -= _root.textSpeed;
  668.          if(this.counter == undefined)
  669.          {
  670.             this.counter = 0;
  671.          }
  672.          this.counter = this.counter + 1;
  673.          if(this.counter > 80)
  674.          {
  675.             this.remove = true;
  676.          }
  677.       };
  678.    }
  679.    _root.ef.push(_loc6_);
  680. };
  681. checkScore = function()
  682. {
  683.    var _loc3_ = 50;
  684.    var _loc2_ = _root.pc.length;
  685.    if(_loc2_ > 1)
  686.    {
  687.       if(_root.pc[_loc2_ - 1] == _root.pc[_loc2_ - 2])
  688.       {
  689.          _loc3_ = _loc2_ * 50;
  690.          _root.thing.desiredWidth += 2;
  691.          if(!_root.freePlayActive)
  692.          {
  693.             _root.kongregateStats.submit("chain",_loc2_);
  694.          }
  695.       }
  696.       else
  697.       {
  698.          _root.thing.desiredWidth = 16;
  699.          var _loc4_ = _root.pc[_loc2_ - 1];
  700.          _root.pc = new Array();
  701.          _root.pc.push(_loc4_);
  702.       }
  703.    }
  704.    return _loc3_;
  705. };
  706. assignScalingVars = function(t)
  707. {
  708.    t.sumax = 100 + random(30);
  709.    t.sumin = 90 - random(20);
  710.    t.susp = 2 + random(2);
  711.    t.su = random(10) % 2 != 0 ? false : true;
  712.    if(t.su)
  713.    {
  714.       t._xscale = t.sumin;
  715.       t._yscale = t.sumin;
  716.    }
  717.    else
  718.    {
  719.       t._xscale = t.sumax;
  720.       t._yscale = t.sumax;
  721.    }
  722. };
  723. timeMove = function()
  724. {
  725.    if(!this.lightning)
  726.    {
  727.       if(!this.ghost)
  728.       {
  729.          if(random(10) % 2 == 0)
  730.          {
  731.             if(this.su)
  732.             {
  733.                if(this._xscale < this.sumax)
  734.                {
  735.                   this._xscale += this.susp;
  736.                   this._yscale += this.susp;
  737.                }
  738.                else
  739.                {
  740.                   this.su = false;
  741.                }
  742.             }
  743.             else if(this._xscale > this.sumin)
  744.             {
  745.                this._xscale -= this.susp;
  746.                this._yscale -= this.susp;
  747.             }
  748.             else
  749.             {
  750.                this.su = true;
  751.             }
  752.          }
  753.       }
  754.    }
  755.    var _loc4_ = getTimer();
  756.    var _loc3_ = _loc4_ - this.then;
  757.    if(_loc3_ > 100)
  758.    {
  759.       _loc3_ = 10;
  760.    }
  761.    this.then = _loc4_;
  762.    var _loc5_ = (this.speed + _root.baseSpeed) * _loc3_ / 30;
  763.    this._y += _loc5_;
  764.    if(this.rad == undefined)
  765.    {
  766.       this.rad = 0;
  767.    }
  768.    if(!this.lightning)
  769.    {
  770.       if(_root.nonUniformDropSpeedActive)
  771.       {
  772.          if(this.speed == 1)
  773.          {
  774.             this.speed = 1 + random(3) + random(1000) / 1000;
  775.          }
  776.       }
  777.       else
  778.       {
  779.          this.speed = 1;
  780.       }
  781.       if(_root.rotationActive)
  782.       {
  783.          if(this.rotsp == undefined)
  784.          {
  785.             this.rotsp = 1 + random(4);
  786.             if(random(10) % 2 == 0)
  787.             {
  788.                this.rotsp *= -1;
  789.             }
  790.          }
  791.          this._rotation += this.rotsp;
  792.       }
  793.       if(_root.wavyMotionActive)
  794.       {
  795.          k = 1;
  796.          if(this.dir == undefined)
  797.          {
  798.             this.dir = random(10) % 2;
  799.          }
  800.          this.rad += k / 180 * 3.141592653589793;
  801.          if(this.dir == 0)
  802.          {
  803.             this._x -= _root.cos(this.rad);
  804.          }
  805.          else
  806.          {
  807.             this._x += _root.cos(this.rad);
  808.          }
  809.       }
  810.       if(_root.shakyMotionActive == true)
  811.       {
  812.          _root.k = _root.k + 1;
  813.          if(_root.k > 50)
  814.          {
  815.             _root.k = 0;
  816.          }
  817.          this.rad += k / 180 * 3.141592653589793;
  818.          this._x -= _root.cos(this.rad);
  819.       }
  820.    }
  821. };
  822. hitPlayer = function(t)
  823. {
  824.    var _loc5_ = false;
  825.    var _loc6_ = _root.thing._width / 2;
  826.    var _loc2_ = _root.ab(t._x - _root.thing._x);
  827.    var _loc4_ = _root.ab(t._y - _root.thing._y);
  828.    if(_root.magnetismActive)
  829.    {
  830.       if(_loc2_ < 60)
  831.       {
  832.          if(_loc4_ < 60)
  833.          {
  834.             t._x += t._x <= _root.thing._x ? _loc2_ / 12 : (- _loc2_) / 12;
  835.             t._y += t._y <= _root.thing._y ? _loc2_ / 12 : (- _loc2_) / 12;
  836.          }
  837.       }
  838.    }
  839.    if(_loc2_ < _loc6_)
  840.    {
  841.       if(_loc4_ < _loc6_)
  842.       {
  843.          _loc5_ = true;
  844.       }
  845.    }
  846.    return _loc5_;
  847. };
  848. updateCrystal = function()
  849. {
  850.    this.timeMove();
  851.    if(this._y > 430)
  852.    {
  853.       if(_root.netActive)
  854.       {
  855.          _root.showScore(100,this._x,400);
  856.       }
  857.       else
  858.       {
  859.          _root.showScore(10,this._x,400);
  860.       }
  861.       this.remove = true;
  862.    }
  863.    var _loc5_ = _root.ab(this._x - _root.thing._x);
  864.    var _loc6_ = _root.ab(this._y - _root.thing._y);
  865.    if(_root.hitPlayer(this) == true)
  866.    {
  867.       var _loc3_ = 0;
  868.       if(this.ty < 4)
  869.       {
  870.          _root.pc.push(this.ty);
  871.          _loc3_ = _root.checkScore();
  872.       }
  873.       else
  874.       {
  875.          _loc3_ = 250;
  876.       }
  877.       this.remove = true;
  878.       _root.showScore(_loc3_,this._x,this._y);
  879.       var _loc4_ = "ting2";
  880.       _root.playSFX(_loc4_);
  881.    }
  882.    if(random(400) < 1)
  883.    {
  884.       this.showSpark(0,- this._height / 2);
  885.    }
  886. };
  887. decideCrystalSpecialType = function(ty)
  888. {
  889.    var _loc5_ = "";
  890.    var _loc13_ = _root.tetrisActive;
  891.    var _loc14_ = _root.pacmanActive;
  892.    var _loc17_ = _root.matrixActive;
  893.    var _loc15_ = _root.snakeActive;
  894.    var _loc16_ = _root.robotsActive;
  895.    var _loc11_ = 0;
  896.    var _loc9_ = 0;
  897.    var _loc8_ = 0;
  898.    var _loc12_ = 0;
  899.    var _loc10_ = 0;
  900.    var _loc7_ = getTimer();
  901.    if(_loc13_)
  902.    {
  903.       _loc11_ = _loc7_ - _root.tetrisTime;
  904.    }
  905.    if(_loc17_)
  906.    {
  907.       _loc8_ = _loc7_ - _root.matrixTime;
  908.    }
  909.    if(_loc14_)
  910.    {
  911.       _loc9_ = _loc7_ - _root.pacmanTime;
  912.    }
  913.    if(_loc15_)
  914.    {
  915.       _loc12_ = _loc7_ - _root.snakeTime;
  916.    }
  917.    if(_loc16_)
  918.    {
  919.       _loc10_ = _loc7_ - _root.robotsTime;
  920.    }
  921.    var _loc3_ = [_loc11_,_loc8_,_loc9_,_loc12_,_loc10_];
  922.    var _loc4_ = 300000;
  923.    var _loc6_ = -1;
  924.    var _loc2_ = 0;
  925.    while(_loc2_ < 5)
  926.    {
  927.       if(_loc3_[_loc2_] < _loc4_)
  928.       {
  929.          if(_loc3_[_loc2_] != 0)
  930.          {
  931.             _loc4_ = _loc3_[_loc2_];
  932.             _loc6_ = _loc2_;
  933.          }
  934.       }
  935.       _loc2_ = _loc2_ + 1;
  936.    }
  937.    switch(_loc6_)
  938.    {
  939.       case -1:
  940.          _loc5_ = "crystal" + ty;
  941.          break;
  942.       case 0:
  943.          _loc5_ = "tetrisBlock" + (random(7) + 1);
  944.          break;
  945.       case 1:
  946.          _loc5_ = "matrix" + random(2);
  947.          break;
  948.       case 2:
  949.          _loc5_ = "smallPill";
  950.          break;
  951.       case 3:
  952.          _loc5_ = "wrigglyWorm";
  953.          break;
  954.       case 4:
  955.          _loc5_ = "weather" + (1 + random(6));
  956.    }
  957.    return _loc5_;
  958. };
  959. spawnCrystal = function(ty, xx, yy)
  960. {
  961.    _root.crc = _root.crc + 1;
  962.    var _loc4_ = _root.decideCrystalSpecialType(ty);
  963.    var _loc2_ = _root.createEmptyMovieClip("aCrystal" + _root.crc,_root.getNextHighestDepth());
  964.    var _loc5_ = _loc2_.attachMovie(_loc4_,_loc4_,_loc2_.getNextHighestDepth());
  965.    if(_root.pacmanActive)
  966.    {
  967.       ty = 4;
  968.    }
  969.    else if(_root.tetrisActive)
  970.    {
  971.       ty = 5;
  972.    }
  973.    else if(_root.matrixActive)
  974.    {
  975.       ty = 6;
  976.    }
  977.    else if(_root.snakeActive)
  978.    {
  979.       ty = 7;
  980.    }
  981.    else if(_root.robotsActive)
  982.    {
  983.       ty = 8;
  984.    }
  985.    if(xx != undefined)
  986.    {
  987.       _loc2_._x = xx;
  988.    }
  989.    else
  990.    {
  991.       _loc2_._x = _root.getOpenPos();
  992.    }
  993.    if(yy != undefined)
  994.    {
  995.       _loc2_._y = yy;
  996.    }
  997.    else
  998.    {
  999.       _loc2_._y = -20;
  1000.    }
  1001.    _loc2_.ty = ty;
  1002.    _loc2_.speed = 1;
  1003.    _loc2_.then = getTimer();
  1004.    _loc2_.showSpark = _root.showSpark;
  1005.    _loc2_.timeMove = _root.timeMove;
  1006.    _loc2_.remove = false;
  1007.    _loc2_.update = _root.updateCrystal;
  1008.    _root.assignScalingVars(_loc2_);
  1009.    _root.cr.push(_loc2_);
  1010.    if(_root.symmetryActive)
  1011.    {
  1012.       if(_root.symmetrySwitch)
  1013.       {
  1014.          _root.symmetrySwitch = false;
  1015.          _root.spawnCrystal(_loc2_.ty,_loc2_._x < 300 ? 600 - _loc2_._x : 300 - (_loc2_._x - 300),_loc2_._y);
  1016.       }
  1017.       else
  1018.       {
  1019.          _root.symmetrySwitch = true;
  1020.       }
  1021.    }
  1022. };
  1023. getDist = function(x1, y1, x2, y2)
  1024. {
  1025.    return _root.sq(_root.po(x1 - x2,2) + _root.po(y1 - y2,2));
  1026. };
  1027. updateLightningRay = function()
  1028. {
  1029.    this.timeMove();
  1030.    this._alpha = _root.ro(this._alpha - 1);
  1031.    if(this._y > 440)
  1032.    {
  1033.       this.remove = true;
  1034.    }
  1035. };
  1036. findClosest = function(t)
  1037. {
  1038.    var _loc5_ = new Array();
  1039.    _loc5_.push(t);
  1040.    var _loc4_ = _root.cr.length;
  1041.    if(_loc4_ == 0)
  1042.    {
  1043.       return [];
  1044.    }
  1045.    if(_loc4_ < 8)
  1046.    {
  1047.       var _loc2_ = 0;
  1048.       while(_loc2_ < _loc4_)
  1049.       {
  1050.          if(_root.cr[_loc2_].hit != true)
  1051.          {
  1052.             if(_root.cr[_loc2_].boss != true)
  1053.             {
  1054.                _root.cr[_loc2_].hit = true;
  1055.                _loc5_.push(_root.cr[_loc2_]);
  1056.             }
  1057.          }
  1058.          _loc2_ = _loc2_ + 1;
  1059.       }
  1060.    }
  1061.    else
  1062.    {
  1063.       var _loc6_ = 0;
  1064.       var _loc7_ = 0;
  1065.       while(_loc6_ < 8 && _loc7_ < 100)
  1066.       {
  1067.          var _loc3_ = random(_loc4_);
  1068.          if(_root.cr[_loc3_].hit != true)
  1069.          {
  1070.             if(_root.cr[_loc3_].boss != true)
  1071.             {
  1072.                _root.cr[_loc3_].hit = true;
  1073.                _loc5_.push(_root.cr[_loc3_]);
  1074.                _loc6_ = _loc6_ + 1;
  1075.             }
  1076.          }
  1077.          _loc7_ = _loc7_ + 1;
  1078.       }
  1079.    }
  1080.    return _loc5_;
  1081. };
  1082. lightningStrikeNew = function(t)
  1083. {
  1084.    var _loc14_ = new Array();
  1085.    t.hit = true;
  1086.    _loc14_ = _root.findClosest(t);
  1087.    _root.crc = _root.crc + 1;
  1088.    var _loc16_ = _root.createEmptyMovieClip("ray" + _root.crc,_root.getNextHighestDepth());
  1089.    var _loc6_ = _loc16_.createEmptyMovieClip("ray",_loc16_.getNextHighestDepth());
  1090.    _loc6_.lineStyle(1,16777215,100);
  1091.    var _loc17_ = _loc14_.length;
  1092.    var _loc12_ = 1;
  1093.    while(_loc12_ < _loc17_)
  1094.    {
  1095.       if(_loc14_[_loc12_] != undefined)
  1096.       {
  1097.          if(typeof _loc14_[_loc12_] == "movieclip")
  1098.          {
  1099.             var _loc13_ = _loc14_[_loc12_];
  1100.             var _loc5_ = _loc13_._x;
  1101.             var _loc4_ = _loc13_._y;
  1102.             var _loc8_ = _loc14_[0]._x;
  1103.             var _loc7_ = _loc14_[0]._y;
  1104.             _loc13_.remove = true;
  1105.             if(_loc13_.bomb)
  1106.             {
  1107.                _root.showExplosion(_loc5_,_loc4_,false);
  1108.             }
  1109.             if(_loc8_ > 10 && _loc7_ > 10)
  1110.             {
  1111.                var _loc15_ = _root.getDist(_loc5_,_loc4_,_loc8_,_loc7_);
  1112.                if(_loc15_ < 10)
  1113.                {
  1114.                   _loc6_.moveTo(_loc5_,_loc4_);
  1115.                   _loc6_.lineTo(_loc8_,_loc7_);
  1116.                }
  1117.                else
  1118.                {
  1119.                   var _loc11_ = 0;
  1120.                   while(_loc11_ < random(2) + 1)
  1121.                   {
  1122.                      var _loc3_ = _root.ro(_loc15_ / 10);
  1123.                      if(_loc5_ != undefined)
  1124.                      {
  1125.                         if(_loc4_ != undefined)
  1126.                         {
  1127.                            _loc6_.moveTo(_loc5_,_loc4_);
  1128.                            var _loc2_ = 0;
  1129.                            while(_loc2_ < _loc3_)
  1130.                            {
  1131.                               var _loc10_ = (_loc2_ * _loc8_ + (_loc3_ - _loc2_) * _loc5_) / _loc3_ + 6 - random(12);
  1132.                               var _loc9_ = (_loc2_ * _loc7_ + (_loc3_ - _loc2_) * _loc4_) / _loc3_ + 6 - random(12);
  1133.                               _loc6_.lineTo(_loc10_,_loc9_);
  1134.                               _loc2_ = _loc2_ + 1;
  1135.                            }
  1136.                            _loc6_.lineTo(_loc8_,_loc7_);
  1137.                         }
  1138.                      }
  1139.                      _loc11_ = _loc11_ + 1;
  1140.                   }
  1141.                }
  1142.             }
  1143.             _loc6_.filters = [new flash.filters.GlowFilter(8947967,1,8,8,4,1,false,false)];
  1144.             _root.showScore(100,_loc5_,_loc4_);
  1145.          }
  1146.       }
  1147.       _loc12_ = _loc12_ + 1;
  1148.    }
  1149.    _loc16_.speed = 1;
  1150.    _loc16_.then = getTimer();
  1151.    _loc16_.timeMove = _root.timeMove;
  1152.    _loc16_.remove = false;
  1153.    _loc16_.update = _root.updateLightningRay;
  1154.    _loc16_.lightning = true;
  1155.    _root.lig.push(_loc16_);
  1156.    _root.playSFX("lightning001");
  1157. };
  1158. updateLightning = function()
  1159. {
  1160.    this.timeMove();
  1161.    if(this._y > 440)
  1162.    {
  1163.       this.remove = true;
  1164.    }
  1165.    var _loc4_ = _root.ab(this._x - _root.thing._x);
  1166.    var _loc3_ = _root.thing._width / 2;
  1167.    if(_loc4_ < _loc3_)
  1168.    {
  1169.       var _loc5_ = _root.ab(this._y - _root.thing._y);
  1170.       if(_loc5_ < _loc3_)
  1171.       {
  1172.          _root.showText("Lightning",this._x,this._y);
  1173.          this.remove = true;
  1174.          _root.lightningStrikeNew(this);
  1175.       }
  1176.    }
  1177. };
  1178. spawnLightning = function()
  1179. {
  1180.    _root.crc = _root.crc + 1;
  1181.    var _loc2_ = _root.createEmptyMovieClip("aLightning" + _root.crc,_root.getNextHighestDepth());
  1182.    var _loc3_ = _loc2_.attachMovie("lightning","lightn",_loc2_.getNextHighestDepth());
  1183.    _loc2_._x = _root.getOpenPos();
  1184.    _loc2_._y = -20;
  1185.    _loc2_.speed = 1;
  1186.    _loc2_.then = getTimer();
  1187.    _loc2_.timeMove = _root.timeMove;
  1188.    _loc2_.remove = false;
  1189.    _loc2_.update = _root.updateLightning;
  1190.    _root.assignScalingVars(_loc2_);
  1191.    _root.cr.push(_loc2_);
  1192. };
  1193. updateBossBar = function(perc)
  1194. {
  1195.    _root.frame.bossBar.bar._width = 146 * perc;
  1196. };
  1197. showBossBar = function(vis)
  1198. {
  1199.    if(vis)
  1200.    {
  1201.       _root.updateBossBar(100);
  1202.    }
  1203.    _root.frame.bossBar._visible = vis;
  1204. };
  1205. bossOneShot2Update = function()
  1206. {
  1207.    var _loc4_ = getTimer();
  1208.    var _loc3_ = _loc4_ - this.then;
  1209.    if(_loc3_ > 100)
  1210.    {
  1211.       _loc3_ = 10;
  1212.    }
  1213.    this.then = _loc4_;
  1214.    this._x += this.xmov * (_loc3_ / 30);
  1215.    this._y += this.ymov * (_loc3_ / 30);
  1216.    this._rotation += 3;
  1217.    if(this._x < 0)
  1218.    {
  1219.       this.remove = true;
  1220.    }
  1221.    else if(this._x > 600)
  1222.    {
  1223.       this.remove = true;
  1224.    }
  1225.    if(this._y < 0)
  1226.    {
  1227.       this.remove = true;
  1228.    }
  1229.    else if(this._y > 450)
  1230.    {
  1231.       this.remove = true;
  1232.    }
  1233.    if(_root.ab(this._x - _root.thing._x) < (this._width + _root.thing._width) / 2)
  1234.    {
  1235.       if(_root.ab(this._y - _root.thing._y) < (this._width + _root.thing._width) / 2)
  1236.       {
  1237.          _root.loseOneLife();
  1238.          this.remove = true;
  1239.       }
  1240.    }
  1241. };
  1242. bossOneShot1Update = function()
  1243. {
  1244.    var _loc4_ = getTimer();
  1245.    var _loc3_ = _loc4_ - this.then;
  1246.    if(_loc3_ > 100)
  1247.    {
  1248.       _loc3_ = 10;
  1249.    }
  1250.    this.then = _loc4_;
  1251.    if(this.goingUp)
  1252.    {
  1253.       this._x += (this.upX - this._x) / 10;
  1254.       this._y += (30 - this._y) / 10;
  1255.       if(_root.ab(this._x - this.upX) < 10)
  1256.       {
  1257.          if(_root.ab(this._y - 30) < 10)
  1258.          {
  1259.             this.goingUp = false;
  1260.             this.goLeft = this._x <= _root.thing._x ? false : true;
  1261.          }
  1262.       }
  1263.    }
  1264.    else
  1265.    {
  1266.       this._y += this.speed * (_loc3_ / 30);
  1267.       this.speed *= 1.04;
  1268.       if(this.goLeft)
  1269.       {
  1270.          this._x -= this._y / 100 * (_loc3_ / 10);
  1271.          this._rotation += this._y / 300;
  1272.       }
  1273.       else
  1274.       {
  1275.          this._x += this._y / 100 * (_loc3_ / 10);
  1276.          this._rotation -= this._y / 300;
  1277.       }
  1278.    }
  1279.    if(_root.thing.hitTest(this))
  1280.    {
  1281.       this.remove = true;
  1282.       _root.loseOneLife();
  1283.    }
  1284.    if(this._y > 470)
  1285.    {
  1286.       this.remove = true;
  1287.    }
  1288. };
  1289. bossOneShoot = function(xx, yy, shotType, shotrot)
  1290. {
  1291.    _root.crc = _root.crc + 1;
  1292.    var _loc4_ = "boss4Shot" + shotType;
  1293.    var _loc2_ = _root.createEmptyMovieClip("bossShot" + _root.crc,_root.getNextHighestDepth());
  1294.    var _loc5_ = _loc2_.attachMovie("" + _loc4_,"bs",_loc2_.getNextHighestDepth());
  1295.    _loc2_.cpy = true;
  1296.    _loc2_.then = getTimer();
  1297.    if(shotType == 1)
  1298.    {
  1299.       _root.playSFX("shoot" + (random(3) + 1));
  1300.       _loc2_._x = xx;
  1301.       _loc2_._y = yy;
  1302.       _loc2_.speed = 6;
  1303.       _loc2_.goingUp = true;
  1304.       _loc2_.upX = random(10) % 2 != 0 ? xx - 40 : xx + 40;
  1305.       if(_loc2_.upX > 580 || _loc2_.upX < 20)
  1306.       {
  1307.          _loc2_.upX = 20 + random(560);
  1308.       }
  1309.       _loc2_.update = _root.bossOneShot1Update;
  1310.    }
  1311.    else
  1312.    {
  1313.       if(random(10) == 1)
  1314.       {
  1315.          _root.playSFX("ballshoot" + (random(3) + 1));
  1316.       }
  1317.       _loc2_._x = xx + 23;
  1318.       _loc2_._y = yy - 30;
  1319.       _loc2_.speed = 2;
  1320.       _loc2_._rotation = shotrot;
  1321.       _loc2_.xmov = _loc2_.speed * _root.sin(_loc2_._rotation * 0.017453292519943295);
  1322.       _loc2_.ymov = _loc2_.speed * _root.cos(_loc2_._rotation * 0.017453292519943295);
  1323.       _loc2_.update = _root.bossOneShot2Update;
  1324.    }
  1325.    _root.ef.push(_loc2_);
  1326. };
  1327. updateShotAgainstBossOne = function()
  1328. {
  1329.    if(!_root.gamePaused)
  1330.    {
  1331.       var _loc4_ = getTimer();
  1332.       var _loc3_ = _loc4_ - this.then;
  1333.       if(_loc3_ > 100)
  1334.       {
  1335.          _loc3_ = 10;
  1336.       }
  1337.       this.then = _loc4_;
  1338.       this._y -= this.speed * (_loc3_ / 30);
  1339.       this._x += this.xmod * (470 - this._y) / 1000 * (_loc3_ / 30);
  1340.       if(this._y < 0)
  1341.       {
  1342.          this.remove = true;
  1343.       }
  1344.       if(this.targetObj.hitTest(this._x,this._y - 5,true))
  1345.       {
  1346.          this.remove = true;
  1347.          this.targetObj.hitpoints--;
  1348.       }
  1349.    }
  1350. };
  1351. playerShootAgainstBossOne = function(t)
  1352. {
  1353.    _root.crc = _root.crc + 1;
  1354.    var _loc2_ = _root.createEmptyMovieClip("playerShot" + _root.crc,_root.getNextHighestDepth());
  1355.    var _loc3_ = _loc2_.attachMovie("shotAgainstBossOne","shot",_loc2_.getNextHighestDepth());
  1356.    _loc2_._y = _root.thing._y - _root.thing._height / 2;
  1357.    _loc2_._x = _root.thing._x;
  1358.    _loc2_.speed = 5;
  1359.    _loc2_.then = getTimer();
  1360.    _loc2_.remove = false;
  1361.    _loc2_.xmod = -1 + random(3);
  1362.    _loc2_.targetObj = t;
  1363.    _loc2_.update = _root.updateShotAgainstBossOne;
  1364.    _root.ef.push(_loc2_);
  1365. };
  1366. updateBossOne = function()
  1367. {
  1368.    if(!_root.gamePaused)
  1369.    {
  1370.       if(this.state == 2 || this.state == 3)
  1371.       {
  1372.          _root.playerShootAgainstBossOne(this);
  1373.       }
  1374.       var _loc9_ = random(100) / 100;
  1375.       var _loc6_ = random(5) + 1;
  1376.       var _loc8_ = random(5) + 1;
  1377.       this.filters = [new flash.filters.GlowFilter(16776960,_loc9_,_loc6_,_loc6_,_loc8_,3,false,false)];
  1378.       var _loc7_ = getTimer();
  1379.       var _loc4_ = _loc7_ - this.then;
  1380.       if(_loc4_ > 100)
  1381.       {
  1382.          _loc4_ = 10;
  1383.       }
  1384.       this.then = _loc7_;
  1385.       var _loc3_ = this.speed * _loc4_ / 30;
  1386.       this.shotrot = this.shotrot - 1;
  1387.       if(this.shotrot <= -180)
  1388.       {
  1389.          this.shotrot = 180;
  1390.       }
  1391.       if(this.state == 1)
  1392.       {
  1393.          if(this._y < 125)
  1394.          {
  1395.             this._y += this.speed * (_loc4_ / 30);
  1396.          }
  1397.          else
  1398.          {
  1399.             this.state = 2;
  1400.          }
  1401.       }
  1402.       else if(this.state == 2)
  1403.       {
  1404.          if(this.dest == undefined)
  1405.          {
  1406.             this.dest = this.wp[random(8)];
  1407.             this.counter = 0;
  1408.          }
  1409.          this.counter = this.counter + 1;
  1410.          if(this.counter >= 30)
  1411.          {
  1412.             if(random(100) < 4)
  1413.             {
  1414.                _root.bossOneShoot(this._x,this._y,1,0);
  1415.                this.counter = 0;
  1416.             }
  1417.          }
  1418.          if(_root.ab(this._x - this.dest[0]) < 10)
  1419.          {
  1420.             if(_root.ab(this._y - this.dest[1]) < 10)
  1421.             {
  1422.                this.dest = this.wp[random(8)];
  1423.             }
  1424.             else if(this._y < this.dest[1])
  1425.             {
  1426.                this._y += _loc3_;
  1427.             }
  1428.             else
  1429.             {
  1430.                this._y -= _loc3_;
  1431.             }
  1432.          }
  1433.          else if(this._x < this.dest[0])
  1434.          {
  1435.             this._x += _loc3_;
  1436.          }
  1437.          else
  1438.          {
  1439.             this._x -= _loc3_;
  1440.          }
  1441.          if(this.hitpoints < 1200)
  1442.          {
  1443.             this.state = 3;
  1444.          }
  1445.       }
  1446.       else if(this.state == 3)
  1447.       {
  1448.          if(_root.ab(this._x - this.dest[0]) < 10)
  1449.          {
  1450.             if(_root.ab(this._y - this.dest[1]) < 10)
  1451.             {
  1452.                if(random(200) < 1)
  1453.                {
  1454.                   if(random(10) % 2 == 0)
  1455.                   {
  1456.                      this.dest = this.wp[0];
  1457.                   }
  1458.                   else
  1459.                   {
  1460.                      this.dest = this.wp[3];
  1461.                   }
  1462.                }
  1463.             }
  1464.             else if(this._y < this.dest[1])
  1465.             {
  1466.                this._y += _loc3_;
  1467.             }
  1468.             else
  1469.             {
  1470.                this._y -= _loc3_;
  1471.             }
  1472.          }
  1473.          else if(this._x < this.dest[0])
  1474.          {
  1475.             this._x += _loc3_;
  1476.          }
  1477.          else
  1478.          {
  1479.             this._x -= _loc3_;
  1480.          }
  1481.          this.counter = this.counter + 1;
  1482.          if(this.counter >= 12)
  1483.          {
  1484.             _root.bossOneShoot(this._x,this._y,2,120 - this.shotrot);
  1485.             _root.bossOneShoot(this._x,this._y,2,240 - this.shotrot);
  1486.             _root.bossOneShoot(this._x,this._y,2,360 - this.shotrot);
  1487.             this.counter = 0;
  1488.          }
  1489.          if(this.hitpoints < 300)
  1490.          {
  1491.             this.state = 4;
  1492.          }
  1493.       }
  1494.       else if(this.state == 4)
  1495.       {
  1496.          this.hitpoints = this.hitpoints - 1;
  1497.          if(this.hitpoints <= 20)
  1498.          {
  1499.             this.state = 5;
  1500.          }
  1501.       }
  1502.       else if(this.state == 5)
  1503.       {
  1504.          this.hitpoints = this.hitpoints - 1;
  1505.          this._width *= 1.2;
  1506.          if(this.hitpoints <= 0)
  1507.          {
  1508.             this.remove = true;
  1509.             _root.bossOneActive = false;
  1510.             _root.playCurrentTrack();
  1511.             _root.showScore(25000,this._x,this._y);
  1512.             _root.showBossBar(false);
  1513.             _root.kongr_bossOneKilled = true;
  1514.             _root.updateScoresOnKongregate();
  1515.             _root.onEnterFrame = _root.main;
  1516.          }
  1517.       }
  1518.       var _loc5_ = (this.hitpoints - 300) / (this.maxHealth - 300);
  1519.       if(_loc5_ < 0)
  1520.       {
  1521.          _loc5_ = 0;
  1522.       }
  1523.       _root.updateBossBar(_loc5_);
  1524.    }
  1525. };
  1526. clearStageForBoss = function(noscore)
  1527. {
  1528.    if(!noscore)
  1529.    {
  1530.       _root.playSFX("darkboing");
  1531.    }
  1532.    _root.showBossBar(true);
  1533.    for(var _loc3_ in _root.cr)
  1534.    {
  1535.       if(noscore != false)
  1536.       {
  1537.          _root.showScore(500,_root.cr[_loc3_]._x,_root.cr[_loc3_]._y);
  1538.       }
  1539.       _root.cr[_loc3_].remove = true;
  1540.    }
  1541.    _root.showMagnetism(false);
  1542.    _root.showNet(false);
  1543.    _root.showShield(false);
  1544.    _root.showPacmanAvatar(false);
  1545.    _root.showSnakeAvatar(false);
  1546.    _root.showPlanesAvatar(false);
  1547.    _root.magnetismActive = false;
  1548.    _root.netActive = false;
  1549.    _root.shieldActive = false;
  1550.    _root.pacmanActive = false;
  1551.    _root.snakeActive = false;
  1552.    _root.planesTime -= 35000;
  1553.    _root.tunnelActive = false;
  1554.    _root.tunnelController.remove = true;
  1555.    _root.arkanoidActive = false;
  1556.    _root.arkanoidBall.remove = true;
  1557. };
  1558. spawnBossOne = function()
  1559. {
  1560.    _root.clearStageForBoss();
  1561.    _root.showBigSign("BOSS FIGHT #1",false);
  1562.    _root.bossOneActive = true;
  1563.    _root.crc = _root.crc + 1;
  1564.    var _loc2_ = _root.createEmptyMovieClip("boss1" + _root.crc,_root.getNextHighestDepth());
  1565.    var _loc3_ = _loc2_.attachMovie("robot4AsBoss","boss1",_loc2_.getNextHighestDepth());
  1566.    _loc2_._y = -800;
  1567.    _loc2_._x = 300;
  1568.    _loc2_.speed = 4;
  1569.    _loc2_.then = getTimer();
  1570.    _loc2_.state = 1;
  1571.    _loc2_.remove = false;
  1572.    _loc2_.hitpoints = 2400;
  1573.    _loc2_.maxHealth = 2400;
  1574.    _loc2_.shotrot = 180;
  1575.    _loc2_.bossOne = true;
  1576.    _loc2_.update = _root.updateBossOne;
  1577.    _loc2_.boss = true;
  1578.    _loc2_.wp = [[175,125],[250,125],[350,125],[425,125],[175,200],[250,200],[350,200],[425,200]];
  1579.    _root.cr.push(_loc2_);
  1580. };
  1581. updateShotAgainstBossThree = function()
  1582. {
  1583.    if(!_root.gamePaused)
  1584.    {
  1585.       var _loc4_ = getTimer();
  1586.       var _loc3_ = _loc4_ - this.then;
  1587.       if(_loc3_ > 100)
  1588.       {
  1589.          _loc3_ = 10;
  1590.       }
  1591.       this.then = _loc4_;
  1592.       this._y -= this.speed * (_loc3_ / 30);
  1593.       this._x += this.xmod * (470 - this._y) / 1000 * (_loc3_ / 30);
  1594.       if(this._y < 0)
  1595.       {
  1596.          this.remove = true;
  1597.       }
  1598.       if(this.targetObj.hitTest(this._x,this._y - 5,true))
  1599.       {
  1600.          this.remove = true;
  1601.          this.targetObj.hitpoints--;
  1602.       }
  1603.    }
  1604. };
  1605. playerShootAgainstBossThree = function(t)
  1606. {
  1607.    _root.crc = _root.crc + 1;
  1608.    var _loc2_ = _root.createEmptyMovieClip("playerShot" + _root.crc,_root.getNextHighestDepth());
  1609.    var _loc3_ = _loc2_.attachMovie("shotAgainstBossThree","shot",_loc2_.getNextHighestDepth());
  1610.    _loc2_._y = _root.thing._y - _root.thing._height;
  1611.    _loc2_._x = _root.thing._x;
  1612.    _loc2_.speed = 5;
  1613.    _loc2_._width = 1;
  1614.    _loc2_.then = getTimer();
  1615.    _loc2_.remove = false;
  1616.    _loc2_.xmod = -1 + random(3);
  1617.    _loc2_._xscale *= random(10) % 2 != 0 ? -1 : 1;
  1618.    _loc2_.targetObj = t;
  1619.    _loc2_.update = _root.updateShotAgainstBossThree;
  1620.    _root.ef.push(_loc2_);
  1621. };
  1622. bossThreeShot1Update = function()
  1623. {
  1624.    var _loc4_ = getTimer();
  1625.    var _loc3_ = _loc4_ - this.then;
  1626.    if(_loc3_ > 100)
  1627.    {
  1628.       _loc3_ = 10;
  1629.    }
  1630.    this.then = _loc4_;
  1631.    this._x += this.xmov * (_loc3_ / 30);
  1632.    this._y += this.ymov * (_loc3_ / 30);
  1633.    this._rotation += 3;
  1634.    if(this._x < 0)
  1635.    {
  1636.       this.remove = true;
  1637.    }
  1638.    else if(this._x > 600)
  1639.    {
  1640.       this.remove = true;
  1641.    }
  1642.    if(this._y < 0)
  1643.    {
  1644.       this.remove = true;
  1645.    }
  1646.    else if(this._y > 450)
  1647.    {
  1648.       this.remove = true;
  1649.    }
  1650.    if(_root.ab(this._x - _root.thing._x) < (this._width + _root.thing._width) / 2)
  1651.    {
  1652.       if(_root.ab(this._y - _root.thing._y) < (this._width + _root.thing._width) / 2)
  1653.       {
  1654.          _root.loseOneLife();
  1655.          this.remove = true;
  1656.       }
  1657.    }
  1658. };
  1659. bossThreeShot2Update = function()
  1660. {
  1661.    var _loc4_ = getTimer();
  1662.    var _loc3_ = _loc4_ - this.then;
  1663.    if(_loc3_ > 100)
  1664.    {
  1665.       _loc3_ = 10;
  1666.    }
  1667.    this.then = _loc4_;
  1668.    this._x += this.xmov * (_loc3_ / 30);
  1669.    this._y += this.ymov * (_loc3_ / 30);
  1670.    this._rotation += 3;
  1671.    if(this._x < 0)
  1672.    {
  1673.       this.remove = true;
  1674.    }
  1675.    else if(this._x > 600)
  1676.    {
  1677.       this.remove = true;
  1678.    }
  1679.    if(this._y < 0)
  1680.    {
  1681.       this.remove = true;
  1682.    }
  1683.    else if(this._y > 450)
  1684.    {
  1685.       this.remove = true;
  1686.    }
  1687.    if(_root.ab(this._x - _root.thing._x) < (this._width + _root.thing._width) / 2)
  1688.    {
  1689.       if(_root.ab(this._y - _root.thing._y) < (this._width + _root.thing._width) / 2)
  1690.       {
  1691.          _root.loseOneLife();
  1692.          this.remove = true;
  1693.       }
  1694.    }
  1695. };
  1696. bossThreeShoot = function(xx, yy, shotType, xmov, ymov)
  1697. {
  1698.    _root.crc = _root.crc + 1;
  1699.    var _loc3_ = "bossThreeShot" + shotType;
  1700.    var _loc2_ = _root.createEmptyMovieClip("bossShot" + _root.crc,_root.getNextHighestDepth());
  1701.    var _loc4_ = _loc2_.attachMovie("" + _loc3_,"bs",_loc2_.getNextHighestDepth());
  1702.    _loc2_.cpy = true;
  1703.    _loc2_.then = getTimer();
  1704.    _loc2_._x = xx;
  1705.    _loc2_._y = yy;
  1706.    _loc2_.speed = 6;
  1707.    _loc2_.xmov = xmov;
  1708.    _loc2_.ymov = ymov;
  1709.    if(shotType == 1)
  1710.    {
  1711.       _loc2_.update = _root.bossThreeShot1Update;
  1712.    }
  1713.    else
  1714.    {
  1715.       _loc2_.update = _root.bossThreeShot2Update;
  1716.    }
  1717.    _root.ef.push(_loc2_);
  1718. };
  1719. updateBossThree = function()
  1720. {
  1721.    if(!_root.gamePaused)
  1722.    {
  1723.       if(this.state == 2 || this.state == 3)
  1724.       {
  1725.          _root.playerShootAgainstBossThree(this);
  1726.       }
  1727.       var _loc8_ = random(100) / 100;
  1728.       var _loc5_ = random(5) + 1;
  1729.       var _loc7_ = random(5) + 1;
  1730.       this.filters = [new flash.filters.GlowFilter(16776960,_loc8_,_loc5_,_loc5_,_loc7_,3,false,false)];
  1731.       var _loc6_ = getTimer();
  1732.       var _loc3_ = _loc6_ - this.then;
  1733.       if(_loc3_ > 100)
  1734.       {
  1735.          _loc3_ = 10;
  1736.       }
  1737.       this.then = _loc6_;
  1738.       var _loc9_ = this.speed * _loc3_ / 30;
  1739.       if(this.state == 1)
  1740.       {
  1741.          if(this._y < 125)
  1742.          {
  1743.             this._y += this.speed * (_loc3_ / 30);
  1744.          }
  1745.          else
  1746.          {
  1747.             this.state = 2;
  1748.          }
  1749.       }
  1750.       else if(this.state == 2)
  1751.       {
  1752.          this.counter += _loc3_ / 20;
  1753.          if(this.counter >= 3)
  1754.          {
  1755.             this.counter = 0;
  1756.             if(this.shoot == undefined)
  1757.             {
  1758.                this.shoot = 0;
  1759.             }
  1760.             else
  1761.             {
  1762.                this.shoot = this.shoot + 1;
  1763.             }
  1764.             if(this.shoot > 11)
  1765.             {
  1766.                this.shoot = 0;
  1767.             }
  1768.             switch(this.shoot)
  1769.             {
  1770.                case 0:
  1771.                   _root.bossThreeShoot(this._x - 20,this._y + 5,1,1,2);
  1772.                   break;
  1773.                case 1:
  1774.                   _root.bossThreeShoot(this._x + 20,this._y + 5,2,-1,2);
  1775.                   break;
  1776.                case 2:
  1777.                   _root.bossThreeShoot(this._x - 20,this._y + 5,1,2,2);
  1778.                   break;
  1779.                case 3:
  1780.                   _root.bossThreeShoot(this._x + 20,this._y + 5,2,-2,2);
  1781.                   break;
  1782.                case 4:
  1783.                   _root.bossThreeShoot(this._x - 20,this._y + 5,1,1,-2);
  1784.                   break;
  1785.                case 5:
  1786.                   _root.bossThreeShoot(this._x + 20,this._y + 5,2,-1,-2);
  1787.                   break;
  1788.                case 6:
  1789.                   _root.bossThreeShoot(this._x - 20,this._y + 5,1,2,-2);
  1790.                   break;
  1791.                case 7:
  1792.                   _root.bossThreeShoot(this._x + 20,this._y + 5,2,-2,-2);
  1793.                   break;
  1794.                case 8:
  1795.                   _root.bossThreeShoot(this._x - 20,this._y + 5,1,3,-0.2);
  1796.                   break;
  1797.                case 9:
  1798.                   _root.bossThreeShoot(this._x + 20,this._y + 5,2,-3,-0.2);
  1799.                   break;
  1800.                case 10:
  1801.                   _root.bossThreeShoot(this._x - 20,this._y + 5,1,4,0.2);
  1802.                   break;
  1803.                case 11:
  1804.                   _root.bossThreeShoot(this._x + 20,this._y + 5,2,-4,0.2);
  1805.             }
  1806.          }
  1807.          this.count += 0.0003 * _loc3_;
  1808.          this._x = 300 + this.xmov * _root.sin(this.a * this.count + this.asp);
  1809.          this._y = 160 + this.ymov * _root.sin(this.b * this.count);
  1810.          if(this.hitpoints < 200)
  1811.          {
  1812.             this.state = 3;
  1813.          }
  1814.       }
  1815.       else if(this.state == 3)
  1816.       {
  1817.          if(this.modif == undefined)
  1818.          {
  1819.             this.modif = 0.0003;
  1820.          }
  1821.          else if(this.modif >= 0.002)
  1822.          {
  1823.             this.modif += 0.0001;
  1824.          }
  1825.          this.count += this.modif * _loc3_;
  1826.          this._x = 300 + this.xmov * _root.sin(this.a * this.count + this.asp);
  1827.          this._y = 160 + this.ymov * _root.sin(this.b * this.count);
  1828.          if(this.hitpoints < 50)
  1829.          {
  1830.             this.state = 4;
  1831.          }
  1832.       }
  1833.       else if(this.state == 4)
  1834.       {
  1835.          this.hitpoints = this.hitpoints - 1;
  1836.          if(this.hitpoints <= 20)
  1837.          {
  1838.             this.state = 5;
  1839.          }
  1840.       }
  1841.       else if(this.state == 5)
  1842.       {
  1843.          this.hitpoints = this.hitpoints - 1;
  1844.          this._width *= 1.2;
  1845.          if(this.hitpoints <= 0)
  1846.          {
  1847.             this.remove = true;
  1848.             _root.bossThreeActive = false;
  1849.             _root.playCurrentTrack();
  1850.             _root.showScore(60000,this._x,this._y);
  1851.             _root.showBossBar(false);
  1852.             _root.kongr_bossThreeKilled = true;
  1853.             _root.updateScoresOnKongregate();
  1854.             _root.onEnterFrame = _root.main;
  1855.          }
  1856.       }
  1857.       var _loc4_ = (this.hitpoints - 50) / (this.maxHealth - 50);
  1858.       if(_loc4_ < 0)
  1859.       {
  1860.          _loc4_ = 0;
  1861.       }
  1862.       _root.updateBossBar(_loc4_);
  1863.    }
  1864. };
  1865. spawnBossThree = function()
  1866. {
  1867.    _root.clearStageForBoss();
  1868.    _root.showBigSign("BOSS FIGHT #3",false);
  1869.    _root.bossThreeActive = true;
  1870.    _root.crc = _root.crc + 1;
  1871.    var _loc2_ = _root.createEmptyMovieClip("boss3" + _root.crc,_root.getNextHighestDepth());
  1872.    var _loc3_ = _loc2_.attachMovie("bossThree","boss3",_loc2_.getNextHighestDepth());
  1873.    _loc2_._y = -800;
  1874.    _loc2_._x = 300;
  1875.    _loc2_.speed = 4;
  1876.    _loc2_.then = getTimer();
  1877.    _loc2_.state = 1;
  1878.    _loc2_.remove = false;
  1879.    _loc2_.hitpoints = 2600;
  1880.    _loc2_.maxHealth = 2600;
  1881.    _loc2_.bossThree = true;
  1882.    _loc2_.boss = true;
  1883.    _loc2_.update = _root.updateBossThree;
  1884.    _loc2_.count = 0.5;
  1885.    _loc2_.a = 3;
  1886.    _loc2_.b = 4;
  1887.    _loc2_.xmov = 160;
  1888.    _loc2_.ymov = 40;
  1889.    _loc2_.asp = 1.5707963267948966;
  1890.    _root.cr.push(_loc2_);
  1891. };
  1892. updateShotAgainstBossFour = function()
  1893. {
  1894.    if(!_root.gamePaused)
  1895.    {
  1896.       var _loc4_ = getTimer();
  1897.       var _loc3_ = _loc4_ - this.then;
  1898.       if(_loc3_ > 100)
  1899.       {
  1900.          _loc3_ = 10;
  1901.       }
  1902.       this.then = _loc4_;
  1903.       this._y -= this.speed * (_loc3_ / 30);
  1904.       this._x += this.xmod * (470 - this._y) / 1000 * (_loc3_ / 30);
  1905.       if(this._y < 0)
  1906.       {
  1907.          this.remove = true;
  1908.       }
  1909.       if(this.targetObj.hitTest(this._x,this._y - 5,true))
  1910.       {
  1911.          this.remove = true;
  1912.          this.targetObj.hitpoints--;
  1913.       }
  1914.    }
  1915. };
  1916. playerShootAgainstBossFour = function(t)
  1917. {
  1918.    _root.crc = _root.crc + 1;
  1919.    var _loc3_ = 1 + random(3);
  1920.    var _loc2_ = _root.createEmptyMovieClip("playerShot" + _root.crc,_root.getNextHighestDepth());
  1921.    var _loc4_ = _loc2_.attachMovie("shotAgainstBossFour" + _loc3_,"shot",_loc2_.getNextHighestDepth());
  1922.    _loc2_._y = _root.thing._y - _root.thing._height / 2;
  1923.    _loc2_._x = _root.thing._x;
  1924.    _loc2_.speed = 5;
  1925.    _loc2_.then = getTimer();
  1926.    _loc2_.remove = false;
  1927.    _loc2_.xmod = (20 + random(80)) / 100 * -1 + random(3);
  1928.    _loc2_.targetObj = t;
  1929.    _loc2_.update = _root.updateShotAgainstBossFour;
  1930.    _root.ef.push(_loc2_);
  1931. };
  1932. bossFourShot1Update = function()
  1933. {
  1934.    if(!_root.gamePaused)
  1935.    {
  1936.       var _loc3_ = getTimer();
  1937.       var _loc4_ = _loc3_ - this.then;
  1938.       this.then = _loc3_;
  1939.       if(this.col == undefined)
  1940.       {
  1941.          this.col = random(16777215);
  1942.       }
  1943.       if(random(4) == 0)
  1944.       {
  1945.          this.col = random(16777215);
  1946.          this.filters = [new flash.filters.GlowFilter(this.col,1,3,3,3,4,false,false)];
  1947.       }
  1948.       this.count += 0.0024 * _loc4_;
  1949.       this._x = this.cx + this.xmov * _root.sin(this.a * this.count + this.asp);
  1950.       this._y = this.cy + this.ymov * _root.sin(this.b * this.count);
  1951.       this.cx += this.xdir;
  1952.       this.cy += this.ydir;
  1953.       if(this._x < 0)
  1954.       {
  1955.          this.remove = true;
  1956.       }
  1957.       else if(this._x > 600)
  1958.       {
  1959.          this.remove = true;
  1960.       }
  1961.       if(this._y < 0)
  1962.       {
  1963.          this.remove = true;
  1964.       }
  1965.       else if(this._y > 450)
  1966.       {
  1967.          this.remove = true;
  1968.       }
  1969.       if(_root.ab(this._x - _root.thing._x) < (this._width + _root.thing._width) / 2)
  1970.       {
  1971.          if(_root.ab(this._y - _root.thing._y) < (this._width + _root.thing._width) / 2)
  1972.          {
  1973.             _root.loseOneLife();
  1974.             this.remove = true;
  1975.          }
  1976.       }
  1977.    }
  1978. };
  1979. bossFourShoot = function(xx, yy, shotType, shotrot, xdir, ydir)
  1980. {
  1981.    _root.crc = _root.crc + 1;
  1982.    var _loc3_ = "bossFourShot" + shotType;
  1983.    var _loc2_ = _root.createEmptyMovieClip("bossShot" + _root.crc,_root.getNextHighestDepth());
  1984.    var _loc4_ = _loc2_.attachMovie("" + _loc3_,"bs",_loc2_.getNextHighestDepth());
  1985.    _loc2_.cpy = true;
  1986.    _loc2_.then = getTimer();
  1987.    _loc2_._x = xx;
  1988.    _loc2_._y = yy;
  1989.    _loc2_.speed = 3;
  1990.    _loc2_.count = 0.5;
  1991.    _loc2_.xdir = xdir * ((10 + random(90)) / 100) * 2;
  1992.    _loc2_.ydir = ydir * ((10 + random(90)) / 100) * 2;
  1993.    _loc2_.cx = xx;
  1994.    _loc2_.cy = yy;
  1995.    _loc2_._alpha = 60 + random(40);
  1996.    _loc2_.a = 3;
  1997.    _loc2_.b = 2;
  1998.    _loc2_.xmov = 50;
  1999.    _loc2_.ymov = 20;
  2000.    _loc2_.asp = 1.5707963267948966;
  2001.    _loc2_.update = _root.bossFourShot1Update;
  2002.    _root.ef.push(_loc2_);
  2003. };
  2004. updateBossFour = function()
  2005. {
  2006.    if(!_root.gamePaused)
  2007.    {
  2008.       if(this.state != 1 && this.state < 4)
  2009.       {
  2010.          _root.playerShootAgainstBossFour(this);
  2011.       }
  2012.       var _loc6_ = getTimer();
  2013.       var _loc3_ = _loc6_ - this.then;
  2014.       if(_loc3_ > 100)
  2015.       {
  2016.          _loc3_ = 10;
  2017.       }
  2018.       this.then = _loc6_;
  2019.       var _loc7_ = this.speed * _loc3_ / 30;
  2020.       if(this.col == undefined)
  2021.       {
  2022.          this.col = random(16777215);
  2023.       }
  2024.       if(random(4) == 0)
  2025.       {
  2026.          this.col = random(16777215);
  2027.          this.filters = [new flash.filters.GlowFilter(this.col,1,3,3,3,4,false,false)];
  2028.       }
  2029.       if(this.state == 1)
  2030.       {
  2031.          if(this._y < 160)
  2032.          {
  2033.             this._y += this.speed * (_loc3_ / 30);
  2034.          }
  2035.          else
  2036.          {
  2037.             this.state = 2;
  2038.          }
  2039.       }
  2040.       else if(this.state == 2)
  2041.       {
  2042.          this.counter = this.counter + 1;
  2043.          if(this.counter >= 30)
  2044.          {
  2045.             if(random(100) < 6)
  2046.             {
  2047.                _root.bossFourShoot(this._x - 90,this._y - 10,1,0,-1,-1);
  2048.                _root.bossFourShoot(this._x - 90,this._y + 30,1,0,-1,0);
  2049.                _root.bossFourShoot(this._x - 90,this._y + 70,1,0,-1,1);
  2050.                _root.bossFourShoot(this._x + 90,this._y - 10,1,0,1,-1);
  2051.                _root.bossFourShoot(this._x + 90,this._y + 30,1,0,1,0);
  2052.                _root.bossFourShoot(this._x + 90,this._y + 70,1,0,1,1);
  2053.                this.counter = 0;
  2054.             }
  2055.          }
  2056.          this.count += 0.0024 * _loc3_;
  2057.          this._x = this.cx + this.xmov * _root.sin(this.a * this.count + this.asp);
  2058.          this._y = this.cy + this.ymov * _root.sin(this.b * this.count);
  2059.          if(random(800) == 0)
  2060.          {
  2061.             this.state = 2.5;
  2062.          }
  2063.          if(this.hitpoints < 500)
  2064.          {
  2065.             this.state = 3;
  2066.          }
  2067.       }
  2068.       else if(this.state == 2.5)
  2069.       {
  2070.          if(this._alpha > 0)
  2071.          {
  2072.             this._alpha -= 3;
  2073.          }
  2074.          else
  2075.          {
  2076.             var _loc5_ = random(3);
  2077.             if(_loc5_ == 0)
  2078.             {
  2079.                this.cx = 200;
  2080.                this.cy = 180;
  2081.             }
  2082.             else if(_loc5_ == 1)
  2083.             {
  2084.                this.cx = 300;
  2085.                this.cy = 160;
  2086.             }
  2087.             else if(_loc5_ == 2)
  2088.             {
  2089.                this.cx = 400;
  2090.                this.cy = 180;
  2091.             }
  2092.             this._x = this.cx;
  2093.             this._y = this.cy;
  2094.             this.count = 0.5;
  2095.             this.state = 2.6;
  2096.          }
  2097.       }
  2098.       else if(this.state == 2.6)
  2099.       {
  2100.          if(this._alpha < 100)
  2101.          {
  2102.             this._alpha += 3;
  2103.          }
  2104.          else
  2105.          {
  2106.             this.state = 2;
  2107.          }
  2108.       }
  2109.       else if(this.state == 3)
  2110.       {
  2111.          this._rotation += 20;
  2112.          if(this.hitpoints < 200)
  2113.          {
  2114.             this.state = 4;
  2115.          }
  2116.       }
  2117.       else if(this.state == 4)
  2118.       {
  2119.          this.hitpoints = this.hitpoints - 1;
  2120.          if(this.hitpoints <= 20)
  2121.          {
  2122.             this.state = 5;
  2123.          }
  2124.       }
  2125.       else if(this.state == 5)
  2126.       {
  2127.          this.hitpoints = this.hitpoints - 1;
  2128.          this._width *= 1.2;
  2129.          if(this.hitpoints <= 0)
  2130.          {
  2131.             this.remove = true;
  2132.             _root.bossFourActive = false;
  2133.             _root.playCurrentTrack();
  2134.             _root.showScore(75000,this._x,this._y);
  2135.             _root.showBossBar(false);
  2136.             _root.kongr_bossFourKilled = true;
  2137.             _root.updateScoresOnKongregate();
  2138.             _root.showBigSign("Well done!\nYou have defeated the last of the Bosses!\n",true);
  2139.          }
  2140.       }
  2141.       var _loc4_ = (this.hitpoints - 200) / (this.maxHealth - 200);
  2142.       if(_loc4_ < 0)
  2143.       {
  2144.          _loc4_ = 0;
  2145.       }
  2146.       _root.updateBossBar(_loc4_);
  2147.    }
  2148. };
  2149. spawnBossFour = function()
  2150. {
  2151.    _root.clearStageForBoss();
  2152.    _root.showBigSign("BOSS FIGHT #4",false);
  2153.    _root.bossFourActive = true;
  2154.    _root.crc = _root.crc + 1;
  2155.    var _loc2_ = _root.createEmptyMovieClip("boss4" + _root.crc,_root.getNextHighestDepth());
  2156.    var _loc3_ = _loc2_.attachMovie("bossFour","boss4",_loc2_.getNextHighestDepth());
  2157.    _loc2_._y = -800;
  2158.    _loc2_._x = 300;
  2159.    _loc2_.speed = 4;
  2160.    _loc2_.then = getTimer();
  2161.    _loc2_.state = 1;
  2162.    _loc2_.remove = false;
  2163.    _loc2_.hitpoints = 2600;
  2164.    _loc2_.maxHealth = 2600;
  2165.    _loc2_.bossFour = true;
  2166.    _loc2_.update = _root.updateBossFour;
  2167.    _loc2_.boss = true;
  2168.    _loc2_.count = 0.5;
  2169.    _loc2_.counter = 0;
  2170.    _loc2_.a = 3;
  2171.    _loc2_.b = 2;
  2172.    _loc2_.xmov = 50;
  2173.    _loc2_.ymov = 20;
  2174.    _loc2_.asp = 1.5707963267948966;
  2175.    _loc2_.cx = 300;
  2176.    _loc2_.cy = 160;
  2177.    _root.cr.push(_loc2_);
  2178. };
  2179. bossTwoShot1Update = function()
  2180. {
  2181.    var _loc4_ = getTimer();
  2182.    var _loc3_ = _loc4_ - this.then;
  2183.    if(_loc3_ > 100)
  2184.    {
  2185.       _loc3_ = 10;
  2186.    }
  2187.    this.then = _loc4_;
  2188.    if(this.spinLeft)
  2189.    {
  2190.       this._rotation -= 2;
  2191.    }
  2192.    else
  2193.    {
  2194.       this._rotation += 2;
  2195.    }
  2196.    if(this.goingUp)
  2197.    {
  2198.       this._x += (this.upX - this._x) / 10;
  2199.       this._y += (30 - this._y) / 10;
  2200.       if(_root.ab(this._x - this.upX) < 10)
  2201.       {
  2202.          if(_root.ab(this._y - 30) < 10)
  2203.          {
  2204.             this.goingUp = false;
  2205.             this.goLeft = this._x <= _root.thing._x ? false : true;
  2206.          }
  2207.       }
  2208.    }
  2209.    else
  2210.    {
  2211.       if(this.k == undefined)
  2212.       {
  2213.          this.k = -3.141592653589793 + Math.random() * 3.141592653589793;
  2214.          this.rad = random(180);
  2215.       }
  2216.       this.rad += this.k / 180 * 3.141592653589793;
  2217.       this._x += _root.cos(this.rad) * 6;
  2218.       this._y += this.speed * (_loc3_ / 30);
  2219.    }
  2220.    if(_root.thing.hitTest(this))
  2221.    {
  2222.       this.remove = true;
  2223.       _root.loseOneLife();
  2224.    }
  2225.    if(this._y > 470)
  2226.    {
  2227.       this.remove = true;
  2228.    }
  2229. };
  2230. bossTwoShoot = function(xx, yy, shotType, shotrot)
  2231. {
  2232.    _root.crc = _root.crc + 1;
  2233.    var _loc3_ = "bossTwoShot" + shotType;
  2234.    var _loc2_ = _root.createEmptyMovieClip("bossShot" + _root.crc,_root.getNextHighestDepth());
  2235.    var _loc5_ = _loc2_.attachMovie("" + _loc3_,"bs",_loc2_.getNextHighestDepth());
  2236.    _loc2_.cpy = true;
  2237.    _loc2_.then = getTimer();
  2238.    _loc2_._x = xx;
  2239.    _loc2_._y = yy;
  2240.    _loc2_.spinLeft = random(10) % 2 != 0 ? false : true;
  2241.    _loc2_.speed = 3;
  2242.    _loc2_.goingUp = true;
  2243.    _loc2_.upX = random(10) % 2 != 0 ? xx - 40 : xx + 40;
  2244.    if(_loc2_.upX > 580 || _loc2_.upX < 20)
  2245.    {
  2246.       _loc2_.upX = 20 + random(560);
  2247.    }
  2248.    _loc2_.update = _root.bossTwoShot1Update;
  2249.    _root.ef.push(_loc2_);
  2250. };
  2251. updateShotAgainstBossTwo = function()
  2252. {
  2253.    if(!_root.gamePaused)
  2254.    {
  2255.       var _loc4_ = getTimer();
  2256.       var _loc3_ = _loc4_ - this.then;
  2257.       if(_loc3_ > 100)
  2258.       {
  2259.          _loc3_ = 10;
  2260.       }
  2261.       this.then = _loc4_;
  2262.       this._y -= this.speed * (_loc3_ / 30);
  2263.       this._x += this.xmod * (470 - this._y) / 1000 * (_loc3_ / 30);
  2264.       this._width += 0.25;
  2265.       if(this._y < 0)
  2266.       {
  2267.          this.remove = true;
  2268.       }
  2269.       if(this.targetObj.hitTest(this._x,this._y - 5,true))
  2270.       {
  2271.          this.remove = true;
  2272.          this.targetObj.hitpoints--;
  2273.       }
  2274.    }
  2275. };
  2276. playerShootAgainstBossTwo = function(t)
  2277. {
  2278.    _root.crc = _root.crc + 1;
  2279.    var _loc2_ = _root.createEmptyMovieClip("playerShot" + _root.crc,_root.getNextHighestDepth());
  2280.    var _loc3_ = _loc2_.attachMovie("shotAgainstBossTwo","shot",_loc2_.getNextHighestDepth());
  2281.    _loc2_._y = _root.thing._y - _root.thing._height / 2;
  2282.    _loc2_._x = _root.thing._x;
  2283.    _loc2_.speed = 5;
  2284.    _loc2_._width = 1;
  2285.    _loc2_.then = getTimer();
  2286.    _loc2_.remove = false;
  2287.    _loc2_.xmod = -1 + random(3);
  2288.    _loc2_.targetObj = t;
  2289.    _loc2_.update = _root.updateShotAgainstBossTwo;
  2290.    _root.ef.push(_loc2_);
  2291. };
  2292. updateBossTwo = function()
  2293. {
  2294.    if(!_root.gamePaused)
  2295.    {
  2296.       if(this.state == 2 || this.state == 3)
  2297.       {
  2298.          _root.playerShootAgainstBossTwo(this);
  2299.       }
  2300.       var _loc6_ = getTimer();
  2301.       var _loc4_ = _loc6_ - this.then;
  2302.       if(_loc4_ > 100)
  2303.       {
  2304.          _loc4_ = 10;
  2305.       }
  2306.       this.then = _loc6_;
  2307.       var _loc3_ = this.speed * _loc4_ / 30;
  2308.       this.shotrot = this.shotrot - 1;
  2309.       if(this.shotrot <= -180)
  2310.       {
  2311.          this.shotrot = 180;
  2312.       }
  2313.       if(this.state == 1)
  2314.       {
  2315.          if(this._y < 125)
  2316.          {
  2317.             this._y += this.speed * (_loc4_ / 30);
  2318.          }
  2319.          else
  2320.          {
  2321.             this.state = 2;
  2322.          }
  2323.       }
  2324.       else if(this.state == 2)
  2325.       {
  2326.          if(this.dest == undefined)
  2327.          {
  2328.             this.dest = this.wp[random(8)];
  2329.             this.counter = 0;
  2330.          }
  2331.          this.counter = this.counter + 1;
  2332.          if(this.counter >= 30)
  2333.          {
  2334.             if(random(100) < 6)
  2335.             {
  2336.                _root.bossTwoShoot(this._x,this._y,1,0);
  2337.                this.counter = 0;
  2338.             }
  2339.          }
  2340.          if(_root.ab(this._x - this.dest[0]) < 10)
  2341.          {
  2342.             if(_root.ab(this._y - this.dest[1]) < 10)
  2343.             {
  2344.                this.dest = this.wp[random(8)];
  2345.             }
  2346.             else if(this._y < this.dest[1])
  2347.             {
  2348.                this._y += _loc3_;
  2349.             }
  2350.             else
  2351.             {
  2352.                this._y -= _loc3_;
  2353.             }
  2354.          }
  2355.          else if(this._x < this.dest[0])
  2356.          {
  2357.             this._x += _loc3_;
  2358.          }
  2359.          else
  2360.          {
  2361.             this._x -= _loc3_;
  2362.          }
  2363.          if(this.hitpoints < 500)
  2364.          {
  2365.             this.state = 3;
  2366.          }
  2367.       }
  2368.       else if(this.state == 3)
  2369.       {
  2370.          if(_root.ab(this._x - this.dest[0]) < 10)
  2371.          {
  2372.             if(_root.ab(this._y - this.dest[1]) < 10)
  2373.             {
  2374.                if(random(200) < 1)
  2375.                {
  2376.                   if(random(10) % 2 == 0)
  2377.                   {
  2378.                      this.dest = this.wp[0];
  2379.                   }
  2380.                   else
  2381.                   {
  2382.                      this.dest = this.wp[3];
  2383.                   }
  2384.                }
  2385.             }
  2386.             else if(this._y < this.dest[1])
  2387.             {
  2388.                this._y += _loc3_;
  2389.             }
  2390.             else
  2391.             {
  2392.                this._y -= _loc3_;
  2393.             }
  2394.          }
  2395.          else if(this._x < this.dest[0])
  2396.          {
  2397.             this._x += _loc3_;
  2398.          }
  2399.          else
  2400.          {
  2401.             this._x -= _loc3_;
  2402.          }
  2403.          this.counter = this.counter + 1;
  2404.          if(this.counter >= 25)
  2405.          {
  2406.             _root.bossTwoShoot(this._x,this._y,1,0);
  2407.             this.counter = 0;
  2408.          }
  2409.          if(this.hitpoints < 200)
  2410.          {
  2411.             this.state = 4;
  2412.          }
  2413.       }
  2414.       else if(this.state == 4)
  2415.       {
  2416.          this.hitpoints = this.hitpoints - 1;
  2417.          if(this.hitpoints <= 20)
  2418.          {
  2419.             this.state = 5;
  2420.          }
  2421.       }
  2422.       else if(this.state == 5)
  2423.       {
  2424.          this.hitpoints = this.hitpoints - 1;
  2425.          this._width *= 1.2;
  2426.          if(this.hitpoints <= 0)
  2427.          {
  2428.             this.remove = true;
  2429.             _root.bossTwoActive = false;
  2430.             _root.playCurrentTrack();
  2431.             _root.showScore(40000,this._x,this._y);
  2432.             _root.showBossBar(false);
  2433.             _root.kongr_bossTwoKilled = true;
  2434.             _root.updateScoresOnKongregate();
  2435.             _root.onEnterFrame = _root.main;
  2436.          }
  2437.       }
  2438.       var _loc5_ = (this.hitpoints - 200) / (this.maxHealth - 200);
  2439.       if(_loc5_ < 0)
  2440.       {
  2441.          _loc5_ = 0;
  2442.       }
  2443.       _root.updateBossBar(_loc5_);
  2444.    }
  2445. };
  2446. spawnBossTwo = function()
  2447. {
  2448.    _root.clearStageForBoss();
  2449.    _root.showBigSign("BOSS FIGHT #2",false);
  2450.    _root.bossTwoActive = true;
  2451.    _root.crc = _root.crc + 1;
  2452.    var _loc2_ = _root.createEmptyMovieClip("boss2" + _root.crc,_root.getNextHighestDepth());
  2453.    var _loc3_ = _loc2_.attachMovie("robot3AsBoss","boss2",_loc2_.getNextHighestDepth());
  2454.    _loc2_._y = -800;
  2455.    _loc2_._x = 300;
  2456.    _loc2_.speed = 4;
  2457.    _loc2_.then = getTimer();
  2458.    _loc2_.state = 1;
  2459.    _loc2_.remove = false;
  2460.    _loc2_.hitpoints = 2500;
  2461.    _loc2_.maxHealth = 2500;
  2462.    _loc2_.boss = true;
  2463.    _loc2_.shotrot = 180;
  2464.    _loc2_.bossTwo = true;
  2465.    _loc2_.update = _root.updateBossTwo;
  2466.    _loc2_.wp = [[175,125],[250,125],[350,125],[425,125],[175,200],[250,200],[350,200],[425,200]];
  2467.    _root.cr.push(_loc2_);
  2468. };
  2469. updateDropSpeed = function()
  2470. {
  2471.    this.timeMove();
  2472.    if(this._y > 440)
  2473.    {
  2474.       this.remove = true;
  2475.    }
  2476.    var _loc4_ = _root.ab(this._x - _root.thing._x);
  2477.    var _loc5_ = _root.ab(this._y - _root.thing._y);
  2478.    var _loc3_ = _root.thing._width / 2;
  2479.    if(_loc4_ < _loc3_)
  2480.    {
  2481.       if(_loc5_ < _loc3_)
  2482.       {
  2483.          _root.playPowerupSound();
  2484.          _root.showText("Speed Chaos",this._x,this._y);
  2485.          _root.nonUniformDropSpeedActive = true;
  2486.          _root.nonUniformDropSpeedTime = getTimer();
  2487.          this.remove = true;
  2488.       }
  2489.    }
  2490. };
  2491. updateRotation = function()
  2492. {
  2493.    this.timeMove();
  2494.    if(this._y > 440)
  2495.    {
  2496.       this.remove = true;
  2497.    }
  2498.    var _loc4_ = _root.ab(this._x - _root.thing._x);
  2499.    var _loc5_ = _root.ab(this._y - _root.thing._y);
  2500.    var _loc3_ = _root.thing._width / 2;
  2501.    if(_loc4_ < _loc3_)
  2502.    {
  2503.       if(_loc5_ < _loc3_)
  2504.       {
  2505.          _root.playPowerupSound();
  2506.          _root.showText("Spin",this._x,this._y);
  2507.          _root.rotationActive = true;
  2508.          _root.rotationTime = getTimer();
  2509.          this.remove = true;
  2510.       }
  2511.    }
  2512. };
  2513. spawnDropSpeed = function()
  2514. {
  2515.    _root.crc = _root.crc + 1;
  2516.    var _loc2_ = _root.createEmptyMovieClip("aDropSpeed" + _root.crc,_root.getNextHighestDepth());
  2517.    var _loc3_ = _loc2_.attachMovie("dropSpeed","dropSpeed" + _root.crc,_loc2_.getNextHighestDepth());
  2518.    _loc2_._x = _root.getOpenPos();
  2519.    _loc2_._y = -20;
  2520.    _loc2_.speed = 1;
  2521.    _loc2_.then = getTimer();
  2522.    _loc2_.timeMove = _root.timeMove;
  2523.    _loc2_.remove = false;
  2524.    _loc2_.update = _root.updateDropSpeed;
  2525.    _root.assignScalingVars(_loc2_);
  2526.    _root.cr.push(_loc2_);
  2527. };
  2528. spawnRotation = function()
  2529. {
  2530.    _root.crc = _root.crc + 1;
  2531.    var _loc2_ = _root.createEmptyMovieClip("aRotation" + _root.crc,_root.getNextHighestDepth());
  2532.    var _loc3_ = _loc2_.attachMovie("rotation","rotation" + _root.crc,_loc2_.getNextHighestDepth());
  2533.    _loc2_._x = _root.getOpenPos();
  2534.    _loc2_._y = -20;
  2535.    _loc2_.speed = 1;
  2536.    _loc2_.then = getTimer();
  2537.    _loc2_.timeMove = _root.timeMove;
  2538.    _loc2_.remove = false;
  2539.    _loc2_.update = _root.updateRotation;
  2540.    _root.assignScalingVars(_loc2_);
  2541.    _root.cr.push(_loc2_);
  2542. };
  2543. updateSnake = function()
  2544. {
  2545.    this.timeMove();
  2546.    if(this._y > 440)
  2547.    {
  2548.       this.remove = true;
  2549.    }
  2550.    var _loc4_ = _root.ab(this._x - _root.thing._x);
  2551.    var _loc5_ = _root.ab(this._y - _root.thing._y);
  2552.    var _loc3_ = _root.thing._width / 2;
  2553.    if(_loc4_ < _loc3_)
  2554.    {
  2555.       if(_loc5_ < _loc3_)
  2556.       {
  2557.          _root.playPowerupSound();
  2558.          _root.showText("Snake",this._x,this._y);
  2559.          _root.snakeActive = true;
  2560.          _root.snakeTime = getTimer();
  2561.          _root.showSnakeAvatar(true);
  2562.          this.remove = true;
  2563.       }
  2564.    }
  2565. };
  2566. spawnSnake = function()
  2567. {
  2568.    _root.crc = _root.crc + 1;
  2569.    var _loc2_ = _root.createEmptyMovieClip("aSnake" + _root.crc,_root.getNextHighestDepth());
  2570.    var _loc3_ = _loc2_.attachMovie("snake","snake" + _root.crc,_loc2_.getNextHighestDepth());
  2571.    _loc2_._x = _root.getOpenPos();
  2572.    _loc2_._y = -20;
  2573.    _loc2_.speed = 1;
  2574.    _loc2_.then = getTimer();
  2575.    _loc2_.timeMove = _root.timeMove;
  2576.    _loc2_.remove = false;
  2577.    _loc2_.update = _root.updateSnake;
  2578.    _root.assignScalingVars(_loc2_);
  2579.    _root.cr.push(_loc2_);
  2580. };
  2581. showExplosionBlack = function(x, y, playSound)
  2582. {
  2583.    _root.crc = _root.crc + 1;
  2584.    var _loc3_ = _root.createEmptyMovieClip("anExplosoinBlack" + _root.crc,_root.getNextHighestDepth());
  2585.    var _loc4_ = _loc3_.attachMovie("planeExplosion","pe",_loc3_.getNextHighestDepth());
  2586.    _loc3_._x = x;
  2587.    _loc3_._y = y;
  2588.    _loc3_.co = 30;
  2589.    _loc3_._rotation = random(360);
  2590.    _loc3_.update = function()
  2591.    {
  2592.       this.co = this.co - 1;
  2593.       if(this.co < 0)
  2594.       {
  2595.          this.remove = true;
  2596.       }
  2597.    };
  2598.    _root.ef.push(_loc3_);
  2599.    if(playSound)
  2600.    {
  2601.       _root.playSFX("bomb004");
  2602.    }
  2603. };
  2604. showExplosion = function(x, y, playSound)
  2605. {
  2606.    if(_root.planesActive)
  2607.    {
  2608.       _root.showExplosionBlack(x,y,playSound);
  2609.    }
  2610.    else
  2611.    {
  2612.       _root.crc = _root.crc + 1;
  2613.       var _loc3_ = _root.createEmptyMovieClip("aExplosion" + _root.crc,_root.getNextHighestDepth());
  2614.       var _loc4_ = _loc3_.attachMovie("bombExplosion","be" + _root.crc,_loc3_.getNextHighestDepth());
  2615.       _loc3_._x = x;
  2616.       _loc3_._y = y;
  2617.       _loc3_.co = 30;
  2618.       _loc3_._rotation = random(360);
  2619.       _loc3_.update = function()
  2620.       {
  2621.          this.co = this.co - 1;
  2622.          if(this.co < 0)
  2623.          {
  2624.             this.remove = true;
  2625.          }
  2626.       };
  2627.       _root.ef.push(_loc3_);
  2628.       if(playSound)
  2629.       {
  2630.          _root.playSFX("bomb004");
  2631.       }
  2632.    }
  2633. };
  2634. loseOneLife = function()
  2635. {
  2636.    _root.playSFX("whuw");
  2637.    if(_root.playerLives >= 0)
  2638.    {
  2639.       _root.frame.livesGui["life" + _root.playerLives].gotoAndPlay("blink");
  2640.    }
  2641.    _root.playerLives = _root.playerLives - 1;
  2642.    if(_root.playerLives < 0)
  2643.    {
  2644.       delete _root.frame.update;
  2645.       _root.gotoAndStop("gameOver");
  2646.    }
  2647. };
  2648. updateBomb = function()
  2649. {
  2650.    this.timeMove();
  2651.    if(this._y > 440)
  2652.    {
  2653.       this.remove = true;
  2654.    }
  2655.    if(_root.matrixActive)
  2656.    {
  2657.       this.bomb_mc.gotoAndStop("glow");
  2658.    }
  2659.    else
  2660.    {
  2661.       this.bomb_mc.gotoAndStop("normal");
  2662.    }
  2663.    var _loc4_ = _root.ab(this._x - _root.thing._x);
  2664.    var _loc5_ = _root.ab(this._y - _root.thing._y);
  2665.    var _loc3_ = _root.thing._width / 2;
  2666.    if(_loc4_ < _loc3_)
  2667.    {
  2668.       if(_loc5_ < _loc3_)
  2669.       {
  2670.          this.remove = true;
  2671.          _root.showExplosion(this._x,this._y,true);
  2672.          if(!_root.shieldActive)
  2673.          {
  2674.             var _loc6_ = -100;
  2675.             _root.showScore(_loc6_,this._x,this._y);
  2676.             _root.thing.desiredWidth = 16;
  2677.             _root.pc = new Array();
  2678.             _root.loseOneLife();
  2679.          }
  2680.       }
  2681.    }
  2682. };
  2683. spawnBomb = function(xx, yy, q)
  2684. {
  2685.    _root.crc = _root.crc + 1;
  2686.    var _loc2_ = _root.createEmptyMovieClip("aBomb" + _root.crc,_root.getNextHighestDepth());
  2687.    var _loc3_ = _loc2_.attachMovie("bomb3","bomb_mc",_loc2_.getNextHighestDepth());
  2688.    if(xx != undefined)
  2689.    {
  2690.       _loc2_._x = xx;
  2691.    }
  2692.    else
  2693.    {
  2694.       _loc2_._x = _root.getOpenPos();
  2695.    }
  2696.    if(yy != undefined)
  2697.    {
  2698.       _loc2_._y = yy;
  2699.    }
  2700.    else
  2701.    {
  2702.       _loc2_._y = -20;
  2703.    }
  2704.    _loc2_.remove = false;
  2705.    _loc2_.speed = 1;
  2706.    _loc2_.then = getTimer();
  2707.    _loc2_.bomb = true;
  2708.    _loc2_.timeMove = _root.timeMove;
  2709.    _root.assignScalingVars(_loc2_);
  2710.    _loc2_.update = _root.updateBomb;
  2711.    if(q == true)
  2712.    {
  2713.       _root.cr_queue.push(_loc2_);
  2714.    }
  2715.    else
  2716.    {
  2717.       _root.cr.push(_loc2_);
  2718.    }
  2719.    if(_root.symmetryActive)
  2720.    {
  2721.       if(_root.symmetrySwitch)
  2722.       {
  2723.          _root.symmetrySwitch = false;
  2724.          _root.spawnBomb(_loc2_._x < 300 ? 600 - _loc2_._x : 300 - (_loc2_._x - 300),_loc2_._y);
  2725.       }
  2726.       else
  2727.       {
  2728.          _root.symmetrySwitch = true;
  2729.       }
  2730.    }
  2731. };
  2732. updateWaves = function()
  2733. {
  2734.    this.timeMove();
  2735.    if(this._y > 440)
  2736.    {
  2737.       this.remove = true;
  2738.    }
  2739.    var _loc4_ = _root.ab(this._x - _root.thing._x);
  2740.    var _loc5_ = _root.ab(this._y - _root.thing._y);
  2741.    var _loc3_ = _root.thing._width / 2;
  2742.    if(_loc4_ < _loc3_)
  2743.    {
  2744.       if(_loc5_ < _loc3_)
  2745.       {
  2746.          _root.playPowerupSound();
  2747.          this.remove = true;
  2748.          _root.showText("Wavy Motion",this._x,this._y);
  2749.          _root.wavyMotionActive = true;
  2750.          _root.shakyMotionActive = false;
  2751.          _root.wavyMotionTime = getTimer();
  2752.       }
  2753.    }
  2754. };
  2755. updateShakes = function()
  2756. {
  2757.    this.timeMove();
  2758.    if(this._y > 440)
  2759.    {
  2760.       this.remove = true;
  2761.    }
  2762.    var _loc4_ = _root.ab(this._x - _root.thing._x);
  2763.    var _loc5_ = _root.ab(this._y - _root.thing._y);
  2764.    var _loc3_ = _root.thing._width / 2;
  2765.    if(_loc4_ < _loc3_)
  2766.    {
  2767.       if(_loc5_ < _loc3_)
  2768.       {
  2769.          _root.playPowerupSound();
  2770.          this.remove = true;
  2771.          _root.showText("Shaky Motion",this._x,this._y);
  2772.          _root.shakyMotionActive = true;
  2773.          _root.wavyMotionActive = false;
  2774.          _root.shakyMotionTime = getTimer();
  2775.       }
  2776.    }
  2777. };
  2778. spawnWaves = function()
  2779. {
  2780.    _root.crc = _root.crc + 1;
  2781.    var _loc2_ = _root.createEmptyMovieClip("aWaves" + _root.crc,_root.getNextHighestDepth());
  2782.    var _loc3_ = _loc2_.attachMovie("waves","waves" + _root.crc,_loc2_.getNextHighestDepth());
  2783.    _loc2_._x = _root.getOpenPos();
  2784.    _loc2_._y = -20;
  2785.    _loc2_.remove = false;
  2786.    _loc2_.speed = 1;
  2787.    _loc2_.then = getTimer();
  2788.    _loc2_.timeMove = _root.timeMove;
  2789.    _loc2_.update = _root.updateWaves;
  2790.    _root.assignScalingVars(_loc2_);
  2791.    _root.cr.push(_loc2_);
  2792. };
  2793. spawnShakes = function()
  2794. {
  2795.    _root.crc = _root.crc + 1;
  2796.    var _loc2_ = _root.createEmptyMovieClip("aShakes" + _root.crc,_root.getNextHighestDepth());
  2797.    var _loc3_ = _loc2_.attachMovie("shakes","shakes" + _root.crc,_loc2_.getNextHighestDepth());
  2798.    _loc2_._x = _root.getOpenPos();
  2799.    _loc2_._y = -20;
  2800.    _loc2_.remove = false;
  2801.    _loc2_.speed = 1;
  2802.    _loc2_.then = getTimer();
  2803.    _loc2_.timeMove = _root.timeMove;
  2804.    _loc2_.update = _root.updateShakes;
  2805.    _root.assignScalingVars(_loc2_);
  2806.    _root.cr.push(_loc2_);
  2807. };
  2808. updateGhost = function()
  2809. {
  2810.    var _loc4_ = _root.thing.hitTest(this);
  2811.    if(_root.rotationActive)
  2812.    {
  2813.       if(this.rotsp == undefined)
  2814.       {
  2815.          this.rotsp = 1 + random(4);
  2816.          if(random(10) % 2 == 0)
  2817.          {
  2818.             this.rotsp *= -1;
  2819.          }
  2820.       }
  2821.       this._rotation += this.rotsp;
  2822.    }
  2823.    if(this.chasing)
  2824.    {
  2825.       if(this._x < _root.thing._x)
  2826.       {
  2827.          this.xspeed = 1;
  2828.       }
  2829.       else
  2830.       {
  2831.          this.xspeed = -1;
  2832.       }
  2833.       if(this._y < _root.thing._y)
  2834.       {
  2835.          this.yspeed = 1;
  2836.       }
  2837.       else
  2838.       {
  2839.          this.yspeed = -1;
  2840.       }
  2841.       var _loc5_ = getTimer();
  2842.       var _loc3_ = _loc5_ - this.then;
  2843.       if(_loc3_ > 100)
  2844.       {
  2845.          _loc3_ = 10;
  2846.       }
  2847.       this.then = _loc5_;
  2848.       this._x += this.xspeed * (_loc3_ / 30);
  2849.       this._y += this.yspeed * (_loc3_ / 30);
  2850.       if(_loc4_)
  2851.       {
  2852.          this.remove = true;
  2853.          _root.thing.desiredWidth = 16;
  2854.          _root.pc = new Array();
  2855.          _root.loseOneLife();
  2856.       }
  2857.    }
  2858.    else
  2859.    {
  2860.       this.timeMove();
  2861.       this._xscale *= -1;
  2862.       if(_loc4_)
  2863.       {
  2864.          this.remove = true;
  2865.          _root.showScore(1000,this._x,this._y);
  2866.       }
  2867.       if(this._x < 30)
  2868.       {
  2869.          this.remove = true;
  2870.       }
  2871.       else if(this._x > 580)
  2872.       {
  2873.          this.remove = true;
  2874.       }
  2875.       if(this._y < 40)
  2876.       {
  2877.          this.remove = true;
  2878.       }
  2879.       else if(this._y > 430)
  2880.       {
  2881.          this.remove = true;
  2882.       }
  2883.    }
  2884. };
  2885. updateYellowPill = function()
  2886. {
  2887.    if(this._y > 225)
  2888.    {
  2889.       var _loc5_ = getTimer();
  2890.       var _loc4_ = _loc5_ - this.then;
  2891.       if(_loc4_ > 100)
  2892.       {
  2893.          _loc4_ = 10;
  2894.       }
  2895.       this.then = _loc5_;
  2896.       this._y -= this.speed * (_loc4_ / 30);
  2897.    }
  2898.    if(_root.thing.hitTest(this))
  2899.    {
  2900.       this.remove = true;
  2901.       _root.playSFX("Crystal4-004");
  2902.       for(var _loc3_ in _root.cr)
  2903.       {
  2904.          if(_root.cr[_loc3_].ghost == true)
  2905.          {
  2906.             _root.cr[_loc3_].chasing = false;
  2907.             _root.cr[_loc3_].ghost_mc.gotoAndStop("panicky");
  2908.          }
  2909.       }
  2910.    }
  2911. };
  2912. makeYellowPills = function()
  2913. {
  2914.    var _loc5_ = [];
  2915.    var _loc3_ = 0;
  2916.    while(_loc3_ < _root.cr.length)
  2917.    {
  2918.       if(_root.cr[_loc3_].boss != true)
  2919.       {
  2920.          _loc5_.push(new flash.geom.Point(_root.cr[_loc3_]._x,_root.cr[_loc3_]._y));
  2921.          _root.cr[_loc3_].remove = true;
  2922.       }
  2923.       _loc3_ = _loc3_ + 1;
  2924.    }
  2925.    var _loc4_ = 0;
  2926.    while(_loc4_ < _loc5_.length)
  2927.    {
  2928.       _root.crc = _root.crc + 1;
  2929.       var _loc6_ = 1;
  2930.       var _loc2_ = _root.createEmptyMovieClip("aSmallPill" + _root.crc,_root.getNextHighestDepth());
  2931.       var _loc7_ = _loc2_.attachMovie("smallPill","smallPill",_loc2_.getNextHighestDepth());
  2932.       _loc2_.speed = 1;
  2933.       _loc2_._x = _loc5_[_loc4_].x;
  2934.       _loc2_._y = _loc5_[_loc4_].y;
  2935.       _loc2_.ty = 4;
  2936.       _loc2_.then = getTimer();
  2937.       _loc2_.remove = false;
  2938.       _loc2_.timeMove = _root.timeMove;
  2939.       _loc2_.update = _root.updateCrystal;
  2940.       _root.assignScalingVars(_loc2_);
  2941.       _root.cr_queue.push(_loc2_);
  2942.       _loc4_ = _loc4_ + 1;
  2943.    }
  2944. };
  2945. updatePacman = function()
  2946. {
  2947.    this.timeMove();
  2948.    if(this._y > 440)
  2949.    {
  2950.       this.remove = true;
  2951.    }
  2952.    var _loc6_ = _root.ab(this._x - _root.thing._x);
  2953.    var _loc7_ = _root.ab(this._y - _root.thing._y);
  2954.    var _loc5_ = _root.thing._width / 2;
  2955.    if(_loc6_ < _loc5_)
  2956.    {
  2957.       if(_loc7_ < _loc5_)
  2958.       {
  2959.          _root.playPowerupSound();
  2960.          _root.makeYellowPills();
  2961.          this.remove = true;
  2962.          _root.showText("Pacman",this._x,this._y);
  2963.          _root.showPacmanAvatar(true);
  2964.          _root.pacmanActive = true;
  2965.          _root.pacmanTime = getTimer();
  2966.          var _loc3_ = 0;
  2967.          while(_loc3_ < 4)
  2968.          {
  2969.             _root.crc = _root.crc + 1;
  2970.             var _loc4_ = _root.createEmptyMovieClip("ghost" + _root.crc,_root.getNextHighestDepth());
  2971.             var _loc8_ = _loc4_.attachMovie("ghost" + (_loc3_ + 1),"ghost_mc",_loc4_.getNextHighestDepth());
  2972.             _loc4_._x = _loc3_ >= 2 ? 600 : 0;
  2973.             _loc4_._y = _loc3_ % 2 != 0 ? 470 : -20;
  2974.             _loc4_.ghost = true;
  2975.             _loc4_.remove = false;
  2976.             _loc4_.speed = 0.25;
  2977.             _loc4_.xspeed = 1;
  2978.             _loc4_.yspeed = 1;
  2979.             _loc4_.then = getTimer();
  2980.             _loc4_.timeMove = _root.timeMove;
  2981.             _loc4_.update = _root.updateGhost;
  2982.             _loc4_.chasing = true;
  2983.             _root.cr_queue.push(_loc4_);
  2984.             _loc3_ = _loc3_ + 1;
  2985.          }
  2986.          _root.crc = _root.crc + 1;
  2987.          _loc4_ = _root.createEmptyMovieClip("yellowPill" + _root.crc,_root.getNextHighestDepth());
  2988.          _loc8_ = _loc4_.attachMovie("yellowPill","yellowPill",_loc4_.getNextHighestDepth());
  2989.          _loc4_._x = 300;
  2990.          _loc4_._y = 750;
  2991.          _loc4_.remove = false;
  2992.          _loc4_.speed = 2;
  2993.          _loc4_.then = getTimer();
  2994.          _loc4_.update = _root.updateYellowPill;
  2995.          _root.cr_queue.push(_loc4_);
  2996.       }
  2997.    }
  2998. };
  2999. spawnPacman = function()
  3000. {
  3001.    _root.crc = _root.crc + 1;
  3002.    var _loc2_ = _root.createEmptyMovieClip("pacman" + _root.crc,_root.getNextHighestDepth());
  3003.    var _loc3_ = _loc2_.attachMovie("pacmanpowerup","pacmanpowerup",_loc2_.getNextHighestDepth());
  3004.    _loc2_._x = _root.getOpenPos();
  3005.    _loc2_._y = -20;
  3006.    _loc2_.remove = false;
  3007.    _loc2_.speed = 1;
  3008.    _loc2_.then = getTimer();
  3009.    _loc2_.timeMove = _root.timeMove;
  3010.    _loc2_.update = _root.updatePacman;
  3011.    _root.assignScalingVars(_loc2_);
  3012.    _root.cr.push(_loc2_);
  3013. };
  3014. doTetris = function()
  3015. {
  3016.    var _loc5_ = [];
  3017.    var _loc3_ = 0;
  3018.    while(_loc3_ < _root.cr.length)
  3019.    {
  3020.       if(_root.cr[_loc3_].boss != true)
  3021.       {
  3022.          _loc5_.push(new flash.geom.Point(_root.cr[_loc3_]._x,_root.cr[_loc3_]._y));
  3023.          _root.cr[_loc3_].remove = true;
  3024.       }
  3025.       _loc3_ = _loc3_ + 1;
  3026.    }
  3027.    var _loc4_ = 0;
  3028.    while(_loc4_ < _loc5_.length)
  3029.    {
  3030.       _root.crc = _root.crc + 1;
  3031.       var _loc6_ = random(7) + 1;
  3032.       var _loc2_ = _root.createEmptyMovieClip("aTetris" + _root.crc,_root.getNextHighestDepth());
  3033.       var _loc7_ = _loc2_.attachMovie("tetrisBlock" + _loc6_,"tBlock",_loc2_.getNextHighestDepth());
  3034.       _loc2_.speed = 1;
  3035.       _loc2_._x = _loc5_[_loc4_].x;
  3036.       _loc2_._y = _loc5_[_loc4_].y;
  3037.       _loc2_.ty = 5;
  3038.       _loc2_.then = getTimer();
  3039.       _loc2_.remove = false;
  3040.       _loc2_.timeMove = _root.timeMove;
  3041.       _loc2_.update = _root.updateCrystal;
  3042.       _root.assignScalingVars(_loc2_);
  3043.       _root.cr_queue.push(_loc2_);
  3044.       _loc4_ = _loc4_ + 1;
  3045.    }
  3046. };
  3047. updateTetris = function()
  3048. {
  3049.    this.timeMove();
  3050.    if(this._y > 440)
  3051.    {
  3052.       this.remove = true;
  3053.    }
  3054.    var _loc4_ = _root.ab(this._x - _root.thing._x);
  3055.    var _loc5_ = _root.ab(this._y - _root.thing._y);
  3056.    var _loc3_ = _root.thing._width / 2;
  3057.    if(_loc4_ < _loc3_)
  3058.    {
  3059.       if(_loc5_ < _loc3_)
  3060.       {
  3061.          _root.playPowerupSound();
  3062.          this.remove = true;
  3063.          _root.showText("Tetris",this._x,this._y);
  3064.          _root.tetrisActive = true;
  3065.          _root.tetrisTime = getTimer();
  3066.          _root.doTetris();
  3067.       }
  3068.    }
  3069. };
  3070. spawnTetris = function()
  3071. {
  3072.    _root.crc = _root.crc + 1;
  3073.    var _loc2_ = _root.createEmptyMovieClip("tetris" + _root.crc,_root.getNextHighestDepth());
  3074.    var _loc3_ = _loc2_.attachMovie("tetris","tetris",_loc2_.getNextHighestDepth());
  3075.    _loc2_._x = _root.getOpenPos();
  3076.    _loc2_._y = -20;
  3077.    _loc2_.remove = false;
  3078.    _loc2_.speed = 1;
  3079.    _loc2_.then = getTimer();
  3080.    _loc2_.timeMove = _root.timeMove;
  3081.    _loc2_.update = _root.updateTetris;
  3082.    _root.assignScalingVars(_loc2_);
  3083.    _root.cr.push(_loc2_);
  3084. };
  3085. updateSymmetry = function()
  3086. {
  3087.    this.timeMove();
  3088.    if(this._y > 440)
  3089.    {
  3090.       this.remove = true;
  3091.    }
  3092.    var _loc4_ = _root.ab(this._x - _root.thing._x);
  3093.    var _loc5_ = _root.ab(this._y - _root.thing._y);
  3094.    var _loc3_ = _root.thing._width / 2;
  3095.    if(_loc4_ < _loc3_)
  3096.    {
  3097.       if(_loc5_ < _loc3_)
  3098.       {
  3099.          _root.playPowerupSound();
  3100.          this.remove = true;
  3101.          _root.showText("Symmetry",this._x,this._y);
  3102.          _root.symmetryActive = true;
  3103.          _root.symmetryTime = getTimer();
  3104.          _root.symmetrySwicth = true;
  3105.       }
  3106.    }
  3107. };
  3108. spawnSymmetry = function()
  3109. {
  3110.    _root.crc = _root.crc + 1;
  3111.    var _loc2_ = _root.createEmptyMovieClip("symmetry" + _root.crc,_root.getNextHighestDepth());
  3112.    var _loc3_ = _loc2_.attachMovie("symmetry","symmetry",_loc2_.getNextHighestDepth());
  3113.    _loc2_._x = _root.getOpenPos();
  3114.    _loc2_._y = -20;
  3115.    _loc2_.remove = false;
  3116.    _loc2_.speed = 1;
  3117.    _loc2_.then = getTimer();
  3118.    _loc2_.timeMove = _root.timeMove;
  3119.    _loc2_.update = _root.updateSymmetry;
  3120.    _root.assignScalingVars(_loc2_);
  3121.    _root.cr.push(_loc2_);
  3122. };
  3123. whiteBg.update = function()
  3124. {
  3125.    if(_root.planesActive)
  3126.    {
  3127.       var _loc4_ = getTimer();
  3128.       var _loc3_ = _loc4_ - _root.planesTime;
  3129.       if(this._currentframe == 1)
  3130.       {
  3131.          this.play();
  3132.       }
  3133.       else if(this._currentframe == 95)
  3134.       {
  3135.          _root.planesActive = false;
  3136.          _root.showPlanesAvatar(false);
  3137.          this.gotoAndStop("fadein");
  3138.       }
  3139.       if(_loc3_ > 15000 && this._currentframe == 35)
  3140.       {
  3141.          this.play();
  3142.       }
  3143.    }
  3144. };
  3145. updateFighterPlane = function()
  3146. {
  3147.    var _loc4_ = getTimer();
  3148.    var _loc3_ = _loc4_ - this.then;
  3149.    if(_loc3_ > 100)
  3150.    {
  3151.       _loc3_ = 10;
  3152.    }
  3153.    this.then = _loc4_;
  3154.    if(this.xspeed != 0)
  3155.    {
  3156.       if(this.xspeed > 0)
  3157.       {
  3158.          this._x += (this.xspeed + _root.baseSpeed) * (_loc3_ / 30);
  3159.       }
  3160.       else
  3161.       {
  3162.          this._x += (this.xspeed - _root.baseSpeed) * (_loc3_ / 30);
  3163.       }
  3164.    }
  3165.    this._y += (this.yspeed + _root.baseSpeed) * (_loc3_ / 30);
  3166.    if(this.hitpoints < 1)
  3167.    {
  3168.       this.remove = true;
  3169.       _root.showScore(200,this._x,this._y);
  3170.       _root.showExplosionBlack(this._x,this._y,true);
  3171.    }
  3172.    if(this._y > 470)
  3173.    {
  3174.       this.remove = true;
  3175.    }
  3176. };
  3177. spawnFighterPlane = function()
  3178. {
  3179.    _root.crc = _root.crc + 1;
  3180.    var _loc2_ = _root.createEmptyMovieClip("fighterPlane" + _root.crc,_root.getNextHighestDepth());
  3181.    var _loc3_ = _loc2_.attachMovie("fighterPlane","fighterPlane",_loc2_.getNextHighestDepth());
  3182.    _loc2_._y = -40;
  3183.    _loc2_.fighter = true;
  3184.    _loc2_.remove = false;
  3185.    _loc2_.xspeed = -1 + random(3);
  3186.    _loc2_._rotation = _loc2_.xspeed != -1 ? (_loc2_.xspeed != 0 ? 135 : 180) : -135;
  3187.    _loc2_._x = _loc2_.xspeed != -1 ? (_loc2_.xspeed != 0 ? -100 : 100 + random(400)) : 700;
  3188.    _loc2_.yspeed = 1 + (random(10) + 1) / 10;
  3189.    _loc2_.then = getTimer();
  3190.    _loc2_.hitpoints = 1;
  3191.    _loc2_.update = _root.updateFighterPlane;
  3192.    _root.cr_queue.push(_loc2_);
  3193. };
  3194. updateBomberPlane = function()
  3195. {
  3196.    var _loc4_ = getTimer();
  3197.    var _loc3_ = _loc4_ - this.then;
  3198.    if(_loc3_ > 100)
  3199.    {
  3200.       _loc3_ = 10;
  3201.    }
  3202.    this.then = _loc4_;
  3203.    this._y += (this.yspeed + _root.baseSpeed) * (_loc3_ / 30);
  3204.    if(this.hitpoints < 1)
  3205.    {
  3206.       this.remove = true;
  3207.       _root.showScore(800,this._x,this._y);
  3208.       _root.showExplosionBlack(this._x,this._y,true);
  3209.    }
  3210.    if(this._y > 500)
  3211.    {
  3212.       this.remove = true;
  3213.    }
  3214. };
  3215. spawnBomberPlane = function()
  3216. {
  3217.    _root.crc = _root.crc + 1;
  3218.    var _loc2_ = _root.createEmptyMovieClip("bomberPlane" + _root.crc,_root.getNextHighestDepth());
  3219.    var _loc3_ = _loc2_.attachMovie("bomberPlane","bomberPlane",_loc2_.getNextHighestDepth());
  3220.    _loc2_._y = -40;
  3221.    _loc2_.fighter = true;
  3222.    _loc2_.remove = false;
  3223.    _loc2_._x = 50 + random(500);
  3224.    _loc2_.yspeed = 0.25;
  3225.    _loc2_.hitpoints = 5;
  3226.    _loc2_.then = getTimer();
  3227.    _loc2_.timeMove = _root.timeMove;
  3228.    _loc2_.update = _root.updateBomberPlane;
  3229.    _root.cr_queue.push(_loc2_);
  3230. };
  3231. doPlanes = function()
  3232. {
  3233.    var _loc3_ = [];
  3234.    var _loc2_ = 0;
  3235.    while(_loc2_ < _root.cr.length)
  3236.    {
  3237.       if(_root.cr[_loc2_].boss != true)
  3238.       {
  3239.          _loc3_.push(new flash.geom.Point(_root.cr[_loc2_]._x,_root.cr[_loc2_]._y));
  3240.          _root.cr[_loc2_].remove = true;
  3241.       }
  3242.       _loc2_ = _loc2_ + 1;
  3243.    }
  3244. };
  3245. updatePlanes = function()
  3246. {
  3247.    this.timeMove();
  3248.    if(this._y > 440)
  3249.    {
  3250.       this.remove = true;
  3251.    }
  3252.    var _loc4_ = _root.ab(this._x - _root.thing._x);
  3253.    var _loc5_ = _root.ab(this._y - _root.thing._y);
  3254.    var _loc3_ = _root.thing._width / 2;
  3255.    if(_loc4_ < _loc3_)
  3256.    {
  3257.       if(_loc5_ < _loc3_)
  3258.       {
  3259.          _root.playPowerupSound();
  3260.          this.remove = true;
  3261.          _root.showText("1945",this._x,this._y);
  3262.          _root.planesActive = true;
  3263.          _root.planesTime = getTimer();
  3264.          _root.doPlanes();
  3265.          _root.showPlanesAvatar(true);
  3266.       }
  3267.    }
  3268. };
  3269. spawnPlanes = function()
  3270. {
  3271.    _root.crc = _root.crc + 1;
  3272.    var _loc2_ = _root.createEmptyMovieClip("planes" + _root.crc,_root.getNextHighestDepth());
  3273.    var _loc3_ = _loc2_.attachMovie("planes","planes",_loc2_.getNextHighestDepth());
  3274.    _loc2_._x = _root.getOpenPos();
  3275.    _loc2_._y = -20;
  3276.    _loc2_.remove = false;
  3277.    _loc2_.speed = 1;
  3278.    _loc2_.then = getTimer();
  3279.    _loc2_.timeMove = _root.timeMove;
  3280.    _loc2_.update = _root.updatePlanes;
  3281.    _root.assignScalingVars(_loc2_);
  3282.    _root.cr.push(_loc2_);
  3283. };
  3284. bossbg.update = function()
  3285. {
  3286.    var _loc6_ = _root.bossOneActive;
  3287.    var _loc5_ = _root.bossTwoActive;
  3288.    var _loc4_ = _root.bossThreeActive;
  3289.    var _loc3_ = _root.bossFourActive;
  3290.    if(_loc6_ || _loc5_ || _loc4_ || _loc3_)
  3291.    {
  3292.       var _loc7_ = getTimer();
  3293.       var _loc8_ = _loc7_ - this.then;
  3294.       if(this._currentframe == 1)
  3295.       {
  3296.          this.play();
  3297.       }
  3298.       else if(this._currentframe == 95)
  3299.       {
  3300.          this.gotoAndStop("fadein");
  3301.       }
  3302.    }
  3303.    if(!(_loc6_ || _loc5_ || _loc4_ || _loc3_) && this._currentframe == 35)
  3304.    {
  3305.       this.play();
  3306.    }
  3307. };
  3308. matrixbg.update = function()
  3309. {
  3310.    if(_root.matrixActive)
  3311.    {
  3312.       var _loc4_ = getTimer();
  3313.       var _loc3_ = _loc4_ - _root.matrixTime;
  3314.       if(this._currentframe == 1)
  3315.       {
  3316.          this.play();
  3317.       }
  3318.       else if(this._currentframe == 95)
  3319.       {
  3320.          _root.matrixActive = false;
  3321.          this.gotoAndStop("fadein");
  3322.       }
  3323.       if(_loc3_ > 15000 && this._currentframe == 35)
  3324.       {
  3325.          this.play();
  3326.       }
  3327.    }
  3328. };
  3329. doMatrix = function()
  3330. {
  3331.    var _loc5_ = [];
  3332.    var _loc3_ = 0;
  3333.    while(_loc3_ < _root.cr.length)
  3334.    {
  3335.       if(_root.cr[_loc3_].boss != true)
  3336.       {
  3337.          _loc5_.push(new flash.geom.Point(_root.cr[_loc3_]._x,_root.cr[_loc3_]._y));
  3338.          _root.cr[_loc3_].remove = true;
  3339.       }
  3340.       _loc3_ = _loc3_ + 1;
  3341.    }
  3342.    var _loc4_ = 0;
  3343.    while(_loc4_ < _loc5_.length)
  3344.    {
  3345.       _root.crc = _root.crc + 1;
  3346.       var _loc2_ = _root.createEmptyMovieClip("aMatrix" + _root.crc,_root.getNextHighestDepth());
  3347.       var _loc6_ = _loc2_.attachMovie("matrix" + ty,"matrix",_loc2_.getNextHighestDepth());
  3348.       _loc2_.speed = 1;
  3349.       _loc2_._x = _loc5_[_loc4_].x;
  3350.       _loc2_._y = _loc5_[_loc4_].y;
  3351.       _loc2_.ty = 6;
  3352.       _loc2_.then = getTimer();
  3353.       _loc2_.remove = false;
  3354.       _loc2_.timeMove = _root.timeMove;
  3355.       _loc2_.update = _root.updateCrystal;
  3356.       _root.assignScalingVars(_loc2_);
  3357.       _root.cr_queue.push(_loc2_);
  3358.       _loc4_ = _loc4_ + 1;
  3359.    }
  3360. };
  3361. updateMatrix = function()
  3362. {
  3363.    this.timeMove();
  3364.    if(this._y > 440)
  3365.    {
  3366.       this.remove = true;
  3367.    }
  3368.    var _loc4_ = _root.ab(this._x - _root.thing._x);
  3369.    var _loc5_ = _root.ab(this._y - _root.thing._y);
  3370.    var _loc3_ = _root.thing._width / 2;
  3371.    if(_loc4_ < _loc3_)
  3372.    {
  3373.       if(_loc5_ < _loc3_)
  3374.       {
  3375.          _root.playPowerupSound();
  3376.          this.remove = true;
  3377.          _root.showText("The Matrix",this._x,this._y);
  3378.          _root.matrixActive = true;
  3379.          _root.matrixTime = getTimer();
  3380.          _root.doMatrix();
  3381.       }
  3382.    }
  3383. };
  3384. spawnMatrix = function()
  3385. {
  3386.    _root.crc = _root.crc + 1;
  3387.    var _loc2_ = _root.createEmptyMovieClip("matrix" + _root.crc,_root.getNextHighestDepth());
  3388.    var _loc3_ = _loc2_.attachMovie("matrix","matrix",_loc2_.getNextHighestDepth());
  3389.    _loc2_._x = _root.getOpenPos();
  3390.    _loc2_._y = -20;
  3391.    _loc2_.remove = false;
  3392.    _loc2_.speed = 1;
  3393.    _loc2_.then = getTimer();
  3394.    _loc2_.timeMove = _root.timeMove;
  3395.    _loc2_.update = _root.updateMatrix;
  3396.    _root.assignScalingVars(_loc2_);
  3397.    _root.cr.push(_loc2_);
  3398. };
  3399. showNet = function(st)
  3400. {
  3401.    _root.net._visible = st;
  3402. };
  3403. showMagnetism = function(st)
  3404. {
  3405.    _root.frame.magnetismIcon._visible = st;
  3406. };
  3407. showShield = function(st)
  3408. {
  3409.    _root.thing.shield._visible = st;
  3410. };
  3411. showPacmanAvatar = function(st)
  3412. {
  3413.    _root.thing.pacman._visible = st;
  3414.    _root.thing.blueThing._visible = !st;
  3415. };
  3416. showSnakeAvatar = function(st)
  3417. {
  3418.    _root.thing.snakeHead._visible = st;
  3419.    _root.thing.blueThing._visible = !st;
  3420. };
  3421. showPlanesAvatar = function(st)
  3422. {
  3423.    if(st)
  3424.    {
  3425.       _root.thing.planeHolder.attachMovie("playerPlane","playerPlane",_root.thing.planeHolder.getNextHighestDepth());
  3426.       _root.thing._width = 50;
  3427.       _root.thing._height = 36.5;
  3428.       _root.thing.blueThing._visible = false;
  3429.       _root.thing.pacman._visible = false;
  3430.       _root.thing.snakeHead._visible = false;
  3431.       _root.showShield(false);
  3432.       _root.thing.update = _root.thingAlternativeUpdate;
  3433.    }
  3434.    else
  3435.    {
  3436.       _root.thing.planeHolder.playerPlane.removeMovieClip();
  3437.       _root.thing._width = 29;
  3438.       _root.thing._height = 29;
  3439.       _root.thing.blueThing._visible = true;
  3440.       _root.thing.update = _root.thingUpdate;
  3441.    }
  3442. };
  3443. updateMagnetism = function()
  3444. {
  3445.    this.timeMove();
  3446.    if(this._y > 440)
  3447.    {
  3448.       this.remove = true;
  3449.    }
  3450.    var _loc4_ = _root.ab(this._x - _root.thing._x);
  3451.    var _loc5_ = _root.ab(this._y - _root.thing._y);
  3452.    var _loc3_ = _root.thing._width / 2;
  3453.    if(_loc4_ < _loc3_)
  3454.    {
  3455.       if(_loc5_ < _loc3_)
  3456.       {
  3457.          _root.playPowerupSound();
  3458.          this.remove = true;
  3459.          _root.showText("Magnetism",this._x,this._y);
  3460.          _root.magnetismActive = true;
  3461.          _root.magnetismActiveTime = getTimer();
  3462.          _root.showMagnetism(true);
  3463.       }
  3464.    }
  3465. };
  3466. updateBombTrigger = function()
  3467. {
  3468.    this.timeMove();
  3469.    if(this._y > 440)
  3470.    {
  3471.       this.remove = true;
  3472.    }
  3473.    var _loc5_ = _root.ab(this._x - _root.thing._x);
  3474.    var _loc6_ = _root.ab(this._y - _root.thing._y);
  3475.    var _loc4_ = _root.thing._width / 2;
  3476.    if(_loc5_ < _loc4_)
  3477.    {
  3478.       if(_loc6_ < _loc4_)
  3479.       {
  3480.          this.remove = true;
  3481.          _root.showText("Mine Trigger",this._x,this._y);
  3482.          _root.playSFX("bomb004");
  3483.          for(var _loc3_ in _root.cr)
  3484.          {
  3485.             if(_root.cr[_loc3_].bomb == true)
  3486.             {
  3487.                _root.cr[_loc3_].remove = true;
  3488.                _root.showExplosion(_root.cr[_loc3_]._x,_root.cr[_loc3_]._y,false);
  3489.                _root.showScore(100,_root.cr[_loc3_]._x,_root.cr[_loc3_]._y);
  3490.             }
  3491.          }
  3492.       }
  3493.    }
  3494. };
  3495. spawnBombTrigger = function()
  3496. {
  3497.    _root.crc = _root.crc + 1;
  3498.    var _loc2_ = _root.createEmptyMovieClip("aBombTrigger" + _root.crc,_root.getNextHighestDepth());
  3499.    var _loc3_ = _loc2_.attachMovie("bombTrigger","bombTrigger" + _root.crc,_loc2_.getNextHighestDepth());
  3500.    _loc2_._x = _root.getOpenPos();
  3501.    _loc2_._y = -20;
  3502.    _loc2_.remove = false;
  3503.    _loc2_.speed = 1;
  3504.    _loc2_.then = getTimer();
  3505.    _loc2_.timeMove = _root.timeMove;
  3506.    _loc2_.update = _root.updateBombTrigger;
  3507.    _root.assignScalingVars(_loc2_);
  3508.    _root.cr.push(_loc2_);
  3509. };
  3510. updateNet = function()
  3511. {
  3512.    this.timeMove();
  3513.    if(this._y > 440)
  3514.    {
  3515.       this.remove = true;
  3516.    }
  3517.    var _loc4_ = _root.ab(this._x - _root.thing._x);
  3518.    var _loc5_ = _root.ab(this._y - _root.thing._y);
  3519.    var _loc3_ = _root.thing._width / 2;
  3520.    if(_loc4_ < _loc3_)
  3521.    {
  3522.       if(_loc5_ < _loc3_)
  3523.       {
  3524.          _root.playPowerupSound();
  3525.          this.remove = true;
  3526.          _root.showText("Barrier",this._x,this._y);
  3527.          _root.netActive = true;
  3528.          _root.netActiveTime = getTimer();
  3529.          _root.showNet(true);
  3530.       }
  3531.    }
  3532. };
  3533. spawnNet = function()
  3534. {
  3535.    _root.crc = _root.crc + 1;
  3536.    var _loc2_ = _root.createEmptyMovieClip("aNet" + _root.crc,_root.getNextHighestDepth());
  3537.    var _loc3_ = _loc2_.attachMovie("net","net" + _root.crc,_loc2_.getNextHighestDepth());
  3538.    _loc2_._x = _root.getOpenPos();
  3539.    _loc2_._y = -20;
  3540.    _loc2_.remove = false;
  3541.    _loc2_.speed = 1;
  3542.    _loc2_.then = getTimer();
  3543.    _loc2_.timeMove = _root.timeMove;
  3544.    _loc2_.update = _root.updateNet;
  3545.    _root.assignScalingVars(_loc2_);
  3546.    _root.cr.push(_loc2_);
  3547. };
  3548. updateShield = function()
  3549. {
  3550.    this.timeMove();
  3551.    if(this._y > 440)
  3552.    {
  3553.       this.remove = true;
  3554.    }
  3555.    var _loc4_ = _root.ab(this._x - _root.thing._x);
  3556.    var _loc5_ = _root.ab(this._y - _root.thing._y);
  3557.    var _loc3_ = _root.thing._width / 2;
  3558.    if(_loc4_ < _loc3_)
  3559.    {
  3560.       if(_loc5_ < _loc3_)
  3561.       {
  3562.          _root.playPowerupSound();
  3563.          this.remove = true;
  3564.          _root.showText("Shield",this._x,this._y);
  3565.          _root.shieldActive = true;
  3566.          _root.shieldActiveTime = getTimer();
  3567.          _root.showShield(true);
  3568.       }
  3569.    }
  3570. };
  3571. spawnShield = function()
  3572. {
  3573.    _root.crc = _root.crc + 1;
  3574.    var _loc2_ = _root.createEmptyMovieClip("aShield" + _root.crc,_root.getNextHighestDepth());
  3575.    var _loc3_ = _loc2_.attachMovie("shield","shield" + _root.crc,_loc2_.getNextHighestDepth());
  3576.    _loc2_._x = _root.getOpenPos();
  3577.    _loc2_._y = -20;
  3578.    _loc2_.remove = false;
  3579.    _loc2_.speed = 1;
  3580.    _loc2_.then = getTimer();
  3581.    _loc2_.timeMove = _root.timeMove;
  3582.    _loc2_.update = _root.updateShield;
  3583.    _root.assignScalingVars(_loc2_);
  3584.    _root.cr.push(_loc2_);
  3585. };
  3586. spawnMagnetism = function()
  3587. {
  3588.    _root.crc = _root.crc + 1;
  3589.    var _loc2_ = _root.createEmptyMovieClip("aMagnetism" + _root.crc,_root.getNextHighestDepth());
  3590.    var _loc3_ = _loc2_.attachMovie("magnetism","magnetism" + _root.crc,_loc2_.getNextHighestDepth());
  3591.    _loc2_._x = _root.getOpenPos();
  3592.    _loc2_._y = -20;
  3593.    _loc2_.remove = false;
  3594.    _loc2_.speed = 1;
  3595.    _loc2_.then = getTimer();
  3596.    _loc2_.timeMove = _root.timeMove;
  3597.    _loc2_.update = _root.updateMagnetism;
  3598.    _root.assignScalingVars(_loc2_);
  3599.    _root.cr.push(_loc2_);
  3600. };
  3601. doSuperSpawn = function()
  3602. {
  3603.    _root.spawnCrystalChance = 50;
  3604. };
  3605. updateSuperSpawn = function()
  3606. {
  3607.    this.timeMove();
  3608.    if(this._y > 440)
  3609.    {
  3610.       this.remove = true;
  3611.    }
  3612.    var _loc4_ = _root.ab(this._x - _root.thing._x);
  3613.    var _loc5_ = _root.ab(this._y - _root.thing._y);
  3614.    var _loc3_ = _root.thing._width / 2;
  3615.    if(_loc4_ < _loc3_)
  3616.    {
  3617.       if(_loc5_ < _loc3_)
  3618.       {
  3619.          _root.playPowerupSound();
  3620.          this.remove = true;
  3621.          _root.showText("Super Spawn",this._x,this._y);
  3622.          _root.doSuperSpawn();
  3623.       }
  3624.    }
  3625. };
  3626. spawnSuperSpawn = function()
  3627. {
  3628.    _root.crc = _root.crc + 1;
  3629.    var _loc2_ = _root.createEmptyMovieClip("aSuperSpawn" + _root.crc,_root.getNextHighestDepth());
  3630.    var _loc3_ = _loc2_.attachMovie("superSpawn","superSpawn" + _root.crc,_loc2_.getNextHighestDepth());
  3631.    _loc2_._x = _root.getOpenPos();
  3632.    _loc2_._y = -20;
  3633.    _loc2_.remove = false;
  3634.    _loc2_.speed = 1;
  3635.    _loc2_.then = getTimer();
  3636.    _loc2_.timeMove = _root.timeMove;
  3637.    _loc2_.update = _root.updateSuperSpawn;
  3638.    _root.assignScalingVars(_loc2_);
  3639.    _root.cr.push(_loc2_);
  3640. };
  3641. doSuperCrystal = function(ty)
  3642. {
  3643.    var _loc5_ = [];
  3644.    var _loc3_ = 0;
  3645.    while(_loc3_ < _root.cr.length)
  3646.    {
  3647.       if(_root.cr[_loc3_].boss != true)
  3648.       {
  3649.          _loc5_.push(new flash.geom.Point(_root.cr[_loc3_]._x,_root.cr[_loc3_]._y));
  3650.          _root.cr[_loc3_].remove = true;
  3651.       }
  3652.       _loc3_ = _loc3_ + 1;
  3653.    }
  3654.    var _loc4_ = 0;
  3655.    while(_loc4_ < _loc5_.length)
  3656.    {
  3657.       _root.crc = _root.crc + 1;
  3658.       var _loc2_ = _root.createEmptyMovieClip("aSuperCrystalOffSpring" + _root.crc,_root.getNextHighestDepth());
  3659.       var _loc7_ = _loc2_.attachMovie("crystal" + ty,"crystal1" + _root.crc,_loc2_.getNextHighestDepth());
  3660.       _loc2_.speed = 1;
  3661.       _loc2_._x = _loc5_[_loc4_].x;
  3662.       _loc2_._y = _loc5_[_loc4_].y;
  3663.       _loc2_.ty = ty;
  3664.       _loc2_.showSpark = _root.showSpark;
  3665.       _loc2_.then = getTimer();
  3666.       _loc2_.remove = false;
  3667.       _loc2_.timeMove = _root.timeMove;
  3668.       _loc2_.update = _root.updateCrystal;
  3669.       _root.assignScalingVars(_loc2_);
  3670.       _root.cr_queue.push(_loc2_);
  3671.       _loc4_ = _loc4_ + 1;
  3672.    }
  3673. };
  3674. updateSuperCrystal = function()
  3675. {
  3676.    this.timeMove();
  3677.    if(this._y > 440)
  3678.    {
  3679.       this.remove = true;
  3680.    }
  3681.    var _loc4_ = _root.ab(this._x - _root.thing._x);
  3682.    var _loc5_ = _root.ab(this._y - _root.thing._y);
  3683.    var _loc3_ = _root.thing._width / 2;
  3684.    if(_loc4_ < _loc3_)
  3685.    {
  3686.       if(_loc5_ < _loc3_)
  3687.       {
  3688.          _root.playPowerupSound();
  3689.          this.remove = true;
  3690.          _root.showText("Super Crystal",this._x,this._y);
  3691.          this.boss = true;
  3692.          _root.doSuperCrystal(this.ty);
  3693.       }
  3694.    }
  3695. };
  3696. spawnSuperCrystal = function()
  3697. {
  3698.    _root.crc = _root.crc + 1;
  3699.    var _loc4_ = undefined;
  3700.    var _loc6_ = undefined;
  3701.    var _loc3_ = _root.pc[_root.pc.length - 1];
  3702.    if(_loc3_ != 1 && _loc3_ != 2 && _loc3_ != 3)
  3703.    {
  3704.       _loc3_ = random(3) + 1;
  3705.    }
  3706.    switch(_loc3_)
  3707.    {
  3708.       case 1:
  3709.          _loc4_ = "superCrystalGreen";
  3710.          break;
  3711.       case 2:
  3712.          _loc4_ = "superCrystalRed";
  3713.          break;
  3714.       case 3:
  3715.          _loc4_ = "superCrystalYellow";
  3716.          break;
  3717.       default:
  3718.          _loc4_ = "superCrystalGreen";
  3719.          _loc3_ = 1;
  3720.    }
  3721.    var _loc2_ = _root.createEmptyMovieClip("aSuperCrystal" + _root.crc,_root.getNextHighestDepth());
  3722.    var _loc5_ = _loc2_.attachMovie("" + _loc4_,"" + _loc4_,_loc2_.getNextHighestDepth());
  3723.    _loc2_._x = _root.getOpenPos();
  3724.    _loc2_._y = -20;
  3725.    _loc2_.remove = false;
  3726.    _loc2_.speed = 1;
  3727.    _loc2_.then = getTimer();
  3728.    _loc2_.timeMove = _root.timeMove;
  3729.    _loc2_.ty = _loc3_;
  3730.    _loc2_.update = _root.updateSuperCrystal;
  3731.    _root.assignScalingVars(_loc2_);
  3732.    _root.cr.push(_loc2_);
  3733. };
  3734. removeArkanoid = function()
  3735. {
  3736.    _root.arkanoidActive = false;
  3737.    _root.arkanoidBall.remove = true;
  3738.    var _loc2_ = 0;
  3739.    while(_loc2_ < _root.cr.length)
  3740.    {
  3741.       if(_root.cr[_loc2_].arkBlock)
  3742.       {
  3743.          _root.cr[_loc2_].remove = true;
  3744.          _root.showScore(10,_root.cr[_loc2_]._x,_root.cr[_loc2_]._y);
  3745.       }
  3746.       _loc2_ = _loc2_ + 1;
  3747.    }
  3748. };
  3749. arkanoidBallUpdate = function()
  3750. {
  3751.    if(!_root.gamePaused)
  3752.    {
  3753.       _root.crc = _root.crc + 1;
  3754.       var _loc3_ = _root.createEmptyMovieClip("arkanoidTail" + _root.crc,_root.getNextHighestDepth());
  3755.       var _loc8_ = _loc3_.attachMovie("arkanoidBallInside","arkBall",_loc3_.getNextHighestDepth());
  3756.       _loc3_._x = this._x;
  3757.       _loc3_._y = this._y;
  3758.       _loc3_.remove = false;
  3759.       if(_root.arkanoidBall.steel)
  3760.       {
  3761.          _loc3_.arkBall.gotoAndStop("steel");
  3762.       }
  3763.       else
  3764.       {
  3765.          _loc3_.arkBall.gotoAndStop("normal");
  3766.       }
  3767.       _loc3_.update = function()
  3768.       {
  3769.          if(!_root.gamePaused)
  3770.          {
  3771.             if(_root.arkanoidBall.steel)
  3772.             {
  3773.                this.arkBall.gotoAndStop("steel");
  3774.             }
  3775.             else
  3776.             {
  3777.                this.arkBall.gotoAndStop("normal");
  3778.             }
  3779.             this._alpha -= 8;
  3780.             this._xscale *= 0.95;
  3781.             this._yscale *= 0.95;
  3782.             if(this._alpha < 1)
  3783.             {
  3784.                this.remove = true;
  3785.             }
  3786.          }
  3787.       };
  3788.       _root.cr_queue.push(_loc3_);
  3789.       if(this.steel)
  3790.       {
  3791.          this.a1.gotoAndStop("steel");
  3792.       }
  3793.       else
  3794.       {
  3795.          this.a1.gotoAndStop("normal");
  3796.       }
  3797.       if(this.down == undefined)
  3798.       {
  3799.          this.down = false;
  3800.          this.speed = 8;
  3801.          this.steel = false;
  3802.          this.xmov = 0.25 + random(500) / 1000;
  3803.          this.ymov = 1 - this.xmov;
  3804.          this.then = getTimer();
  3805.       }
  3806.       var _loc7_ = getTimer();
  3807.       var _loc4_ = _loc7_ - this.then;
  3808.       this.then = _loc7_;
  3809.       if(_loc4_ > 100)
  3810.       {
  3811.          _loc4_ = 10;
  3812.       }
  3813.       this._x += this.xmov * this.speed * (_loc4_ / 30);
  3814.       this._y += this.ymov * this.speed * (_loc4_ / 30);
  3815.       var _loc6_ = false;
  3816.       var _loc5_ = false;
  3817.       if(this._x < 25)
  3818.       {
  3819.          this._x = 25;
  3820.          _loc5_ = true;
  3821.       }
  3822.       else if(this._x > 575)
  3823.       {
  3824.          this._x = 575;
  3825.          _loc5_ = true;
  3826.       }
  3827.       if(this._y < 20)
  3828.       {
  3829.          this._y = 20;
  3830.          _loc6_ = true;
  3831.       }
  3832.       else if(this._y > 425)
  3833.       {
  3834.          this._y = 425;
  3835.          _loc6_ = true;
  3836.       }
  3837.       if(_loc5_)
  3838.       {
  3839.          this.xmov *= -1;
  3840.       }
  3841.       if(_loc6_)
  3842.       {
  3843.          this.ymov *= -1;
  3844.       }
  3845.    }
  3846. };
  3847. updateSteelBallPowerup = function()
  3848. {
  3849.    this.timeMove();
  3850.    if(this._y > 440)
  3851.    {
  3852.       this.remove = true;
  3853.    }
  3854.    var _loc4_ = _root.ab(this._x - _root.thing._x);
  3855.    var _loc5_ = _root.ab(this._y - _root.thing._y);
  3856.    var _loc3_ = _root.thing._width / 2;
  3857.    if(_loc4_ < _loc3_)
  3858.    {
  3859.       if(_loc5_ < _loc3_)
  3860.       {
  3861.          this.remove = true;
  3862.          _root.showText("Super Ball",this._x,this._y);
  3863.          _root.arkanoidBall.steel = true;
  3864.       }
  3865.    }
  3866. };
  3867. spawnArkanoidSteelBall = function(xx, yy)
  3868. {
  3869.    _root.crc = _root.crc + 1;
  3870.    var _loc2_ = _root.createEmptyMovieClip("steelballpowerup" + _root.crc,_root.getNextHighestDepth());
  3871.    var _loc3_ = _loc2_.attachMovie("arkanoidSteelBall","stB",_loc2_.getNextHighestDepth());
  3872.    _loc2_._x = xx;
  3873.    _loc2_._y = yy;
  3874.    _loc2_.remove = false;
  3875.    _loc2_.then = getTimer();
  3876.    _loc2_.timeMove = _root.timeMove;
  3877.    _loc2_.speed = 1;
  3878.    _loc2_.update = _root.updateSteelBallPowerup;
  3879.    _root.cr_queue.push(_loc2_);
  3880. };
  3881. updateArkanoidBlock = function()
  3882. {
  3883.    if(!_root.gamePaused)
  3884.    {
  3885.       if(!this.inPlace)
  3886.       {
  3887.          this._x += (this._destx - this._x) / 5;
  3888.          this._y += (this._desty - this._y) / 5;
  3889.          if(_root.ab(this._x - this._destx) < 1)
  3890.          {
  3891.             if(_root.ab(this._y - this._desty) < 1)
  3892.             {
  3893.                this._x = this._destx;
  3894.                this._y = this._desty;
  3895.                this.inPlace = true;
  3896.             }
  3897.          }
  3898.       }
  3899.       else
  3900.       {
  3901.          var _loc3_ = _root.arkanoidBall._y;
  3902.          if(_loc3_ < 180)
  3903.          {
  3904.             if(_root.ab(this._y - _loc3_) < 20)
  3905.             {
  3906.                var _loc6_ = _root.arkanoidBall._x;
  3907.                if(_root.ab(this._x - _loc6_) < 50)
  3908.                {
  3909.                   if(_root.arkanoidBall.hitTest(this))
  3910.                   {
  3911.                      this.hp = this.hp - 1;
  3912.                      if(this.hp <= 0)
  3913.                      {
  3914.                         this.remove = true;
  3915.                         _root.showScore(100,this._x,this._y);
  3916.                         if(random(100) < 10)
  3917.                         {
  3918.                            _root.spawnArkanoidSteelBall(this._x,this._y);
  3919.                         }
  3920.                      }
  3921.                      else
  3922.                      {
  3923.                         this.ark.gotoAndStop("broken");
  3924.                      }
  3925.                      if(!_root.arkanoidBall.steel)
  3926.                      {
  3927.                         var _loc5_ = _root.arkanoidBall._y;
  3928.                         var _loc4_ = this._y + this._height / 2;
  3929.                         if(_loc5_ > _loc4_)
  3930.                         {
  3931.                            while(_root.arkanoidBall.hitTest(this))
  3932.                            {
  3933.                               _root.arkanoidBall._y = _root.arkanoidBall._y + 1;
  3934.                            }
  3935.                            _root.arkanoidBall.ymov *= -1;
  3936.                         }
  3937.                         else
  3938.                         {
  3939.                            _root.arkanoidBall.xmov *= -1;
  3940.                            if(this._x > _root.arkanoidBall._x)
  3941.                            {
  3942.                               while(_root.arkanoidBall.hitTest(this))
  3943.                               {
  3944.                                  _root.arkanoidBall._x--;
  3945.                               }
  3946.                            }
  3947.                            else
  3948.                            {
  3949.                               while(_root.arkanoidBall.hitTest(this))
  3950.                               {
  3951.                                  _root.arkanoidBall._x = _root.arkanoidBall._x + 1;
  3952.                               }
  3953.                            }
  3954.                         }
  3955.                      }
  3956.                   }
  3957.                }
  3958.             }
  3959.          }
  3960.       }
  3961.    }
  3962. };
  3963. makeArkanoidBlock = function(ty, x, y)
  3964. {
  3965.    _root.crc = _root.crc + 1;
  3966.    var _loc2_ = _root.createEmptyMovieClip("ab" + _root.crc,_root.getNextHighestDepth());
  3967.    var _loc4_ = _loc2_.attachMovie("ark" + ty,"ark",_loc2_.getNextHighestDepth());
  3968.    _loc2_._x = - random(800);
  3969.    if(random(10) % 2 == 0)
  3970.    {
  3971.       _loc2_._x *= -1;
  3972.       _loc2_._x += 600;
  3973.    }
  3974.    _loc2_._y = -100;
  3975.    _loc2_._destx = 60 + x * 40;
  3976.    _loc2_._desty = 40 + y * 15;
  3977.    _loc2_.inPlace = false;
  3978.    _loc2_.update = _root.updateArkanoidBlock;
  3979.    _loc2_.remove = false;
  3980.    _loc2_.arkBlock = true;
  3981.    _loc2_.hp = 1;
  3982.    _loc2_._alpha = 60;
  3983.    if(ty == 5)
  3984.    {
  3985.       _loc2_.hp = 2;
  3986.    }
  3987.    _root.cr_queue.push(_loc2_);
  3988. };
  3989. makeArkanoidGrid = function()
  3990. {
  3991.    var _loc4_ = [[5,5,5,5,5,5,5,5,5,5,5,5,5],[2,2,2,4,2,2,5,3,3,1,3,3,3],[2,2,4,4,2,2,5,3,3,1,1,3,3],[2,4,4,4,4,4,5,1,1,1,1,1,3],[4,4,4,4,4,4,5,1,1,1,1,1,1],[2,4,4,4,4,4,5,1,1,1,1,1,3],[2,2,4,4,2,2,5,3,3,1,1,3,3],[2,2,2,4,2,2,5,3,3,1,3,3,3],[5,5,5,5,5,5,5,5,5,5,5,5,5]];
  3992.    var _loc3_ = 0;
  3993.    while(_loc3_ < _loc4_.length)
  3994.    {
  3995.       var _loc2_ = 0;
  3996.       while(_loc2_ < _loc4_[_loc3_].length)
  3997.       {
  3998.          _root.makeArkanoidBlock(_loc4_[_loc3_][_loc2_],_loc2_,_loc3_);
  3999.          _loc2_ = _loc2_ + 1;
  4000.       }
  4001.       _loc3_ = _loc3_ + 1;
  4002.    }
  4003. };
  4004. doArkanoid = function()
  4005. {
  4006.    _root.clearStageForBoss(false);
  4007.    _root.makeArkanoidGrid();
  4008.    _root.arkanoidActive = true;
  4009.    _root.arkanoidTime = getTimer();
  4010.    var _loc2_ = _root.createEmptyMovieClip("arkanoidBall",_root.getNextHighestDepth());
  4011.    var _loc3_ = _loc2_.attachMovie("arkanoidBallInside","a1",_loc2_.getNextHighestDepth());
  4012.    _loc2_.update = _root.arkanoidBallUpdate;
  4013.    _loc2_._x = 300;
  4014.    _loc2_._y = 350;
  4015.    _root.ef.push(_loc2_);
  4016. };
  4017. updateArkanoid = function()
  4018. {
  4019.    this.timeMove();
  4020.    if(this._y > 440)
  4021.    {
  4022.       this.remove = true;
  4023.    }
  4024.    var _loc4_ = _root.ab(this._x - _root.thing._x);
  4025.    var _loc5_ = _root.ab(this._y - _root.thing._y);
  4026.    var _loc3_ = _root.thing._width / 2;
  4027.    if(_loc4_ < _loc3_)
  4028.    {
  4029.       if(_loc5_ < _loc3_)
  4030.       {
  4031.          _root.playPowerupSound();
  4032.          this.remove = true;
  4033.          if(!_root.arkanoidActive)
  4034.          {
  4035.             _root.showText("Arkanoid",this._x,this._y);
  4036.             _root.doArkanoid();
  4037.          }
  4038.       }
  4039.    }
  4040. };
  4041. spawnArkanoid = function()
  4042. {
  4043.    _root.crc = _root.crc + 1;
  4044.    var _loc2_ = _root.createEmptyMovieClip("aArkanoid" + _root.crc,_root.getNextHighestDepth());
  4045.    var _loc3_ = _loc2_.attachMovie("arkanoid","arkanoid",_loc2_.getNextHighestDepth());
  4046.    _loc2_._x = _root.getOpenPos();
  4047.    _loc2_._y = -20;
  4048.    _loc2_.remove = false;
  4049.    _loc2_.speed = 0.8;
  4050.    _loc2_.then = getTimer();
  4051.    _loc2_.timeMove = _root.timeMove;
  4052.    _loc2_.update = _root.updateArkanoid;
  4053.    _root.assignScalingVars(_loc2_);
  4054.    _root.cr.push(_loc2_);
  4055. };
  4056. updateTunnelController = function()
  4057. {
  4058.    var _loc5_ = getTimer();
  4059.    var _loc6_ = _loc5_ - this.then;
  4060.    if(_loc6_ > 200)
  4061.    {
  4062.       this.then = _loc5_;
  4063.       _root.spawnBomb(this.leftx,-20);
  4064.       _root.spawnBomb(this.rightx,-20);
  4065.       var _loc4_ = 25 - random(50);
  4066.       var _loc3_ = 0;
  4067.       if(this.dist > 50 || this.smaller == false)
  4068.       {
  4069.          _loc3_ = random(24);
  4070.       }
  4071.       else
  4072.       {
  4073.          _loc4_ = 8 - random(16);
  4074.          if(random(10) == 1)
  4075.          {
  4076.             this.smaller = false;
  4077.          }
  4078.       }
  4079.       if(!this.smaller)
  4080.       {
  4081.          _loc3_ *= -1;
  4082.       }
  4083.       this.leftx += _loc4_ + _loc3_ / 2;
  4084.       this.rightx += _loc4_ - _loc3_ / 2;
  4085.       if(this.leftx < 20)
  4086.       {
  4087.          this.leftx = 20;
  4088.          this.rightx = this.dist;
  4089.       }
  4090.       if(this.rightx > 580)
  4091.       {
  4092.          this.rightx = 580;
  4093.          this.leftx = 580 - this.dist;
  4094.       }
  4095.       this.dist = this.rightx - this.leftx;
  4096.    }
  4097. };
  4098. doTunnel = function()
  4099. {
  4100.    _root.tunnelActive = true;
  4101.    _root.tunnelTime = getTimer();
  4102.    var _loc2_ = _root.createEmptyMovieClip("tunnelController",_root.getNextHighestDepth());
  4103.    _loc2_.update = _root.updateTunnelController;
  4104.    _loc2_.leftx = 20;
  4105.    _loc2_.rightx = 580;
  4106.    _loc2_.dist = 580;
  4107.    _loc2_.remove = false;
  4108.    _loc2_.smaller = true;
  4109.    _loc2_.then = getTimer();
  4110.    _root.ef.push(_loc2_);
  4111. };
  4112. updateTunnel = function()
  4113. {
  4114.    this.timeMove();
  4115.    if(this._y > 440)
  4116.    {
  4117.       this.remove = true;
  4118.    }
  4119.    var _loc4_ = _root.ab(this._x - _root.thing._x);
  4120.    var _loc5_ = _root.ab(this._y - _root.thing._y);
  4121.    var _loc3_ = _root.thing._width / 2;
  4122.    if(_loc4_ < _loc3_)
  4123.    {
  4124.       if(_loc5_ < _loc3_)
  4125.       {
  4126.          _root.playPowerupSound();
  4127.          this.remove = true;
  4128.          if(!_root.tunnelActive)
  4129.          {
  4130.             _root.showText("Tunnel",this._x,this._y);
  4131.             _root.doTunnel();
  4132.          }
  4133.       }
  4134.    }
  4135. };
  4136. spawnTunnel = function()
  4137. {
  4138.    _root.crc = _root.crc + 1;
  4139.    var _loc2_ = _root.createEmptyMovieClip("aTunnel" + _root.crc,_root.getNextHighestDepth());
  4140.    var _loc3_ = _loc2_.attachMovie("tunnel","tunnel",_loc2_.getNextHighestDepth());
  4141.    _loc2_._x = _root.getOpenPos();
  4142.    _loc2_._y = -20;
  4143.    _loc2_.remove = false;
  4144.    _loc2_.speed = 0.8;
  4145.    _loc2_.then = getTimer();
  4146.    _loc2_.timeMove = _root.timeMove;
  4147.    _loc2_.update = _root.updateTunnel;
  4148.    _root.assignScalingVars(_loc2_);
  4149.    _root.cr.push(_loc2_);
  4150. };
  4151. doRobots = function()
  4152. {
  4153.    _root.robotsActive = true;
  4154.    _root.robotsTime = getTimer();
  4155. };
  4156. updateRobots = function()
  4157. {
  4158.    this.timeMove();
  4159.    if(this._y > 440)
  4160.    {
  4161.       this.remove = true;
  4162.    }
  4163.    var _loc4_ = _root.ab(this._x - _root.thing._x);
  4164.    var _loc5_ = _root.ab(this._y - _root.thing._y);
  4165.    var _loc3_ = _root.thing._width / 2;
  4166.    if(_loc4_ < _loc3_)
  4167.    {
  4168.       if(_loc5_ < _loc3_)
  4169.       {
  4170.          _root.playPowerupSound();
  4171.          this.remove = true;
  4172.          _root.showText("Feel good",this._x,this._y);
  4173.          _root.doRobots();
  4174.       }
  4175.    }
  4176. };
  4177. spawnRobots = function()
  4178. {
  4179.    _root.crc = _root.crc + 1;
  4180.    var _loc2_ = _root.createEmptyMovieClip("aRobots" + _root.crc,_root.getNextHighestDepth());
  4181.    var _loc3_ = _loc2_.attachMovie("robots","robots",_loc2_.getNextHighestDepth());
  4182.    _loc2_._x = _root.getOpenPos();
  4183.    _loc2_._y = -20;
  4184.    _loc2_.remove = false;
  4185.    _loc2_.speed = 0.8;
  4186.    _loc2_.then = getTimer();
  4187.    _loc2_.timeMove = _root.timeMove;
  4188.    _loc2_.update = _root.updateRobots;
  4189.    _root.assignScalingVars(_loc2_);
  4190.    _root.cr.push(_loc2_);
  4191. };
  4192. updateSpeedDown = function()
  4193. {
  4194.    this.timeMove();
  4195.    if(this._y > 440)
  4196.    {
  4197.       this.remove = true;
  4198.    }
  4199.    var _loc4_ = _root.ab(this._x - _root.thing._x);
  4200.    var _loc5_ = _root.ab(this._y - _root.thing._y);
  4201.    var _loc3_ = _root.thing._width / 2;
  4202.    if(_loc4_ < _loc3_)
  4203.    {
  4204.       if(_loc5_ < _loc3_)
  4205.       {
  4206.          _root.playPowerupSound();
  4207.          this.remove = true;
  4208.          _root.showText("Speed Down",this._x,this._y);
  4209.          _root.updateDesiredSpeed(-3);
  4210.          _root.speedUpFast = false;
  4211.       }
  4212.    }
  4213. };
  4214. spawnSpeedDown = function()
  4215. {
  4216.    _root.crc = _root.crc + 1;
  4217.    var _loc2_ = _root.createEmptyMovieClip("aSpeedDown" + _root.crc,_root.getNextHighestDepth());
  4218.    var _loc3_ = _loc2_.attachMovie("speedDown","speedDown" + _root.crc,_loc2_.getNextHighestDepth());
  4219.    _loc2_._x = _root.getOpenPos();
  4220.    _loc2_._y = -20;
  4221.    _loc2_.remove = false;
  4222.    _loc2_.speed = 0.8;
  4223.    _loc2_.then = getTimer();
  4224.    _loc2_.timeMove = _root.timeMove;
  4225.    _loc2_.update = _root.updateSpeedDown;
  4226.    _root.assignScalingVars(_loc2_);
  4227.    _root.cr.push(_loc2_);
  4228. };
  4229. updateSpeedUp = function()
  4230. {
  4231.    this.timeMove();
  4232.    if(this._y > 440)
  4233.    {
  4234.       this.remove = true;
  4235.    }
  4236.    var _loc4_ = _root.ab(this._x - _root.thing._x);
  4237.    var _loc5_ = _root.ab(this._y - _root.thing._y);
  4238.    var _loc3_ = _root.thing._width / 2;
  4239.    if(_loc4_ < _loc3_)
  4240.    {
  4241.       if(_loc5_ < _loc3_)
  4242.       {
  4243.          _root.playPowerupSound();
  4244.          this.remove = true;
  4245.          _root.showText("Speed Up",this._x,this._y);
  4246.          _root.updateDesiredSpeed(3);
  4247.          _root.speedUpFast = true;
  4248.       }
  4249.    }
  4250. };
  4251. spawnSpeedUp = function()
  4252. {
  4253.    _root.crc = _root.crc + 1;
  4254.    var _loc2_ = _root.createEmptyMovieClip("aSpeedUp" + _root.crc,_root.getNextHighestDepth());
  4255.    var _loc3_ = _loc2_.attachMovie("speedUp","speedUp" + _root.crc,_loc2_.getNextHighestDepth());
  4256.    _loc2_._x = _root.getOpenPos();
  4257.    _loc2_._y = -20;
  4258.    _loc2_.remove = false;
  4259.    _loc2_.speed = 1.2;
  4260.    _loc2_.then = getTimer();
  4261.    _loc2_.timeMove = _root.timeMove;
  4262.    _loc2_.update = _root.updateSpeedUp;
  4263.    _root.assignScalingVars(_loc2_);
  4264.    _root.cr.push(_loc2_);
  4265. };
  4266. updateTimersOnUnpause = function()
  4267. {
  4268.    var _loc3_ = getTimer();
  4269.    var _loc2_ = _loc3_ - _root.pauseTime;
  4270.    _root.matrixTime += _loc2_;
  4271.    _root.planesTime += _loc2_;
  4272.    _root.pacmanTime += _loc2_;
  4273.    _root.robotsTime += _loc2_;
  4274.    _root.snakeTime += _loc2_;
  4275.    _root.symmetryTime += _loc2_;
  4276.    _root.tunnelTime += _loc2_;
  4277.    _root.arkanoidTime += _loc2_;
  4278.    _root.tetrisTime += _loc2_;
  4279.    _root.nonUniformDropSpeedTime += _loc2_;
  4280.    _root.rotationTime += _loc2_;
  4281.    _root.shakyMotionTime += _loc2_;
  4282.    _root.wavyMotionTime += _loc2_;
  4283.    _root.shieldActiveTime += _loc2_;
  4284.    _root.netActiveTime += _loc2_;
  4285.    _root.magnetismActiveTime += _loc2_;
  4286. };
  4287. keyListener.onKeyDown = function()
  4288. {
  4289.    if(Key.getCode() == 32)
  4290.    {
  4291.       _root.gamePaused = !_root.gamePaused;
  4292.       if(_root.gamePaused)
  4293.       {
  4294.          _root.pauseTime = getTimer();
  4295.          Mouse.show();
  4296.          _root.gamePausedScreenCampaign._x = 300;
  4297.          _root.toggleMainMenuButtons(true);
  4298.          _root.gamePausedScreenCampaign.swapDepths(_root.getNextHighestDepth());
  4299.          _root.frame.swapDepths(_root.getNextHighestDepth());
  4300.       }
  4301.       else
  4302.       {
  4303.          _root.gamePausedScreenCampaign._x = -475;
  4304.          _root.gamePausedScreenFreePlay._x = -475;
  4305.          _root.creditsScreen._x = -475;
  4306.          _root.helpScreen._x = -475;
  4307.          _root.optionsScreen._x = -475;
  4308.          _root.toggleMainMenuButtons(false);
  4309.          Mouse.hide();
  4310.          _root.updateTimersOnUnpause();
  4311.       }
  4312.    }
  4313. };
  4314. updateSpeedStr = function()
  4315. {
  4316.    if(!_root.gamePaused)
  4317.    {
  4318.       _root.baseSpeedStr = "" + _root.df(_root.baseSpeed,2);
  4319.    }
  4320. };
  4321. clock = function()
  4322. {
  4323.    if(!_root.gamePaused)
  4324.    {
  4325.       _root.seconds = _root.seconds + 1;
  4326.       if(_root.seconds == 60)
  4327.       {
  4328.          if(!_root.freePlayActive)
  4329.          {
  4330.             _root.kongregateStats.submit("campaignMinutes",1);
  4331.          }
  4332.          else
  4333.          {
  4334.             _root.kongregateStats.submit("freePlayMinutes",1);
  4335.          }
  4336.          _root.seconds = 0;
  4337.          _root.minutes = _root.minutes + 1;
  4338.          if(_root.minutes == 60)
  4339.          {
  4340.             _root.minutes = 0;
  4341.             _root.hours = _root.hours + 1;
  4342.          }
  4343.       }
  4344.       _root.timestring = _root.hours <= 9 ? "0" + _root.hours : hours;
  4345.       _root.timestring += ":";
  4346.       _root.timestring += _root.minutes <= 9 ? "0" + _root.minutes : _root.minutes;
  4347.       _root.timestring += ":";
  4348.       _root.timestring += _root.seconds <= 9 ? "0" + _root.seconds : _root.seconds;
  4349.    }
  4350. };
  4351. updateSpawnProbabilities = function()
  4352. {
  4353.    var _loc2_ = _root.powerUpsEnabled;
  4354.    _loc2_ *= 0.15;
  4355.    _root.speedUpActProb = _root.ro(_root.speedUpBaseProb * _loc2_);
  4356.    _root.speedDownActProb = _root.ro(_root.speedDownBaseProb * _loc2_);
  4357.    _root.lightningActProb = _root.ro(_root.lightningBaseProb * _loc2_);
  4358.    _root.netActProb = _root.ro(_root.netBaseProb * _loc2_);
  4359.    _root.triggerActProb = _root.ro(_root.triggerBaseProb * _loc2_);
  4360.    _root.magnetismActProb = _root.ro(_root.magnetismBaseProb * _loc2_);
  4361.    _root.shieldActProb = _root.ro(_root.shieldBaseProb * _loc2_);
  4362.    _root.superSpawnActProb = _root.ro(_root.superSpawnBaseProb * _loc2_);
  4363.    _root.superCrystalsActProb = _root.ro(_root.superCrystalsBaseProb * _loc2_);
  4364.    _root.rotationActProb = _root.ro(_root.rotationBaseProb * _loc2_);
  4365.    _root.nonUniformDropSpeedActProb = _root.ro(_root.nonUniformDropSpeedBaseProb * _loc2_);
  4366.    _root.shakyMotionActProb = _root.ro(_root.shakyMotionBaseProb * _loc2_);
  4367.    _root.wavyMotionActProb = _root.ro(_root.wavyMotionBaseProb * _loc2_);
  4368.    _root.pacmanActProb = _root.ro(_root.pacmanBaseProb * _loc2_);
  4369.    _root.matrixActProb = _root.ro(_root.matrixBaseProb * _loc2_);
  4370.    _root.tetrisActProb = _root.ro(_root.tetrisBaseProb * _loc2_);
  4371.    _root.symmetryActProb = _root.ro(_root.symmetryBaseProb * _loc2_);
  4372.    _root.snakeActProb = _root.ro(_root.snakeBaseProb * _loc2_);
  4373.    _root.planesActProb = _root.ro(_root.planesBaseProb * _loc2_);
  4374.    _root.robotsActProb = _root.ro(_root.robotsBaseProb * _loc2_);
  4375.    _root.tunnelActProb = _root.ro(_root.tunnelBaseProb * _loc2_);
  4376. };
  4377. levelUp = function()
  4378. {
  4379.    if(!_root.freePlayActive)
  4380.    {
  4381.       _root.updateScoresOnKongregate();
  4382.    }
  4383.    if(!_root.gamePaused)
  4384.    {
  4385.       if(!_root.bossOneActive)
  4386.       {
  4387.          if(!_root.bossTwoActive)
  4388.          {
  4389.             if(!_root.bossThreeActive)
  4390.             {
  4391.                if(!_root.bossFourActive)
  4392.                {
  4393.                   if(_root.levelMaxSpeed < _root.MAX_SPEED)
  4394.                   {
  4395.                      _root.levelSpeed += 0.2;
  4396.                      _root.levelMaxSpeed += 0.2;
  4397.                      _root.levelMinSpeed += 0.2;
  4398.                      _root.updateDesiredSpeed(0.2);
  4399.                   }
  4400.                   _root.currentLevel = _root.currentLevel + 1;
  4401.                   if(_root.freePlayActive)
  4402.                   {
  4403.                      if(_root.currentLevel < 3)
  4404.                      {
  4405.                         _root.showSmallSign("Press <SPACE> for Menu");
  4406.                      }
  4407.                   }
  4408.                   else
  4409.                   {
  4410.                      var _loc2_ = 1;
  4411.                      switch(_root.currentLevel)
  4412.                      {
  4413.                         case 1:
  4414.                            _root.speedUpFlag = true;
  4415.                            _root.showBigSign("Speed Up powerup unlocked",false);
  4416.                            _root.showSmallSign("Press <SPACE> for Menu");
  4417.                            break;
  4418.                         case 2:
  4419.                            _root.lightningFlag = true;
  4420.                            _root.speedDownFlag = true;
  4421.                            _root.showBigSign("Lightning powerup unlocked\nSpeed Down powerup unlocked",false);
  4422.                            _root.showSmallSign("Press <SPACE> for Menu");
  4423.                            _loc2_ = 2;
  4424.                            break;
  4425.                         case 3:
  4426.                            _root.playMusic("lovebirds",999,false);
  4427.                            _root.spawnBossOne();
  4428.                            _loc2_ = 0;
  4429.                            break;
  4430.                         case 4:
  4431.                            _root.shieldFlag = true;
  4432.                            _root.showBigSign("Shield powerup unlocked",false);
  4433.                            break;
  4434.                         case 5:
  4435.                            _root.superSpawnFlag = true;
  4436.                            _root.showBigSign("Multi Spawn powerup unlocked",false);
  4437.                            break;
  4438.                         case 6:
  4439.                            _root.netFlag = true;
  4440.                            _root.showBigSign("Barrier powerup unlocked",false);
  4441.                            break;
  4442.                         case 7:
  4443.                            _root.pacmanFlag = true;
  4444.                            _root.showBigSign("Pacman powerup unlocked",false);
  4445.                            break;
  4446.                         case 8:
  4447.                            _root.nonUniformDropSpeedFlag = true;
  4448.                            _root.showBigSign("Speed Chaos powerup unlocked",false);
  4449.                            break;
  4450.                         case 9:
  4451.                            _root.triggerFlag = true;
  4452.                            _root.showBigSign("Mine Trigger powerup unlocked",false);
  4453.                            break;
  4454.                         case 10:
  4455.                            _root.playMusic("attack",999,false);
  4456.                            _root.spawnBossTwo();
  4457.                            _loc2_ = 0;
  4458.                            break;
  4459.                         case 11:
  4460.                            _root.magnetismFlag = true;
  4461.                            _root.showBigSign("Magnetism powerup unlocked",false);
  4462.                            break;
  4463.                         case 12:
  4464.                            _root.superCrystalsFlag = true;
  4465.                            _root.showBigSign("Super Crystals powerup unlocked",false);
  4466.                            break;
  4467.                         case 13:
  4468.                            _root.wavyMotionFlag = true;
  4469.                            _root.showBigSign("Wavy Motion powerup unlocked",false);
  4470.                            break;
  4471.                         case 14:
  4472.                            _root.planesFlag = true;
  4473.                            _root.showBigSign("1942 powerup unlocked",false);
  4474.                            break;
  4475.                         case 15:
  4476.                            _root.rotationFlag = true;
  4477.                            _root.showBigSign("Spin powerup unlocked",false);
  4478.                            break;
  4479.                         case 16:
  4480.                            _root.shakyMotionFlag = true;
  4481.                            _root.showBigSign("Shaky Motion powerup unlocked",false);
  4482.                            break;
  4483.                         case 17:
  4484.                            _root.matrixFlag = true;
  4485.                            _root.showBigSign("Matrix powerup unlocked",false);
  4486.                            break;
  4487.                         case 18:
  4488.                            _root.tetrisFlag = true;
  4489.                            _root.showBigSign("Tetris powerup unlocked",false);
  4490.                            break;
  4491.                         case 19:
  4492.                            _root.playMusic("snap",999,false);
  4493.                            _root.spawnBossThree();
  4494.                            _loc2_ = 0;
  4495.                            break;
  4496.                         case 20:
  4497.                            _root.symmetryFlag = true;
  4498.                            _root.showBigSign("Symmetry powerup unlocked",false);
  4499.                            break;
  4500.                         case 21:
  4501.                            _root.snakeFlag = true;
  4502.                            _root.showBigSign("Snake powerup unlocked",false);
  4503.                            break;
  4504.                         case 22:
  4505.                            _root.robotsFlag = true;
  4506.                            _root.showBigSign("Cheesy powerup unlocked",false);
  4507.                            break;
  4508.                         case 23:
  4509.                            _root.tunnelFlag = true;
  4510.                            _root.showBigSign("Tunnel powerup unlocked",false);
  4511.                            break;
  4512.                         case 24:
  4513.                            _root.playMusic("dreamonmarco",999,false);
  4514.                            _root.spawnBossFour();
  4515.                            _loc2_ = 0;
  4516.                            break;
  4517.                         default:
  4518.                            _loc2_ = 0;
  4519.                      }
  4520.                      _root.powerUpsEnabled += _loc2_;
  4521.                      _root.updateSpawnProbabilities();
  4522.                   }
  4523.                }
  4524.             }
  4525.          }
  4526.       }
  4527.    }
  4528. };
  4529. disableAllFlags = function()
  4530. {
  4531.    _root.speedUpFlag = false;
  4532.    _root.speedDownFlag = false;
  4533.    _root.lightningFlag = false;
  4534.    _root.netFlag = false;
  4535.    _root.triggerFlag = false;
  4536.    _root.magnetismFlag = false;
  4537.    _root.shieldFlag = false;
  4538.    _root.superSpawnFlag = false;
  4539.    _root.superCrystalsFlag = false;
  4540.    _root.rotationFlag = false;
  4541.    _root.nonUniformDropSpeedFlag = false;
  4542.    _root.shakyMotionFlag = false;
  4543.    _root.wavyMotionFlag = false;
  4544.    _root.pacmanFlag = false;
  4545.    _root.matrixFlag = false;
  4546.    _root.tetrisFlag = false;
  4547.    _root.symmetryFlag = false;
  4548.    _root.snakeFlag = false;
  4549.    _root.planesFlag = false;
  4550.    _root.robotsFlag = false;
  4551.    _root.tunnelFlag = false;
  4552.    _root.arkanoidFlag = false;
  4553. };
  4554. showLivesGui = function(sh)
  4555. {
  4556.    _root.frame.livesGui._visible = sh;
  4557. };
  4558. boss1main = function()
  4559. {
  4560.    if(_root.cr_queue.length > 0)
  4561.    {
  4562.       _root.cr = _root.cr.concat(_root.cr_queue);
  4563.       _root.cr_queue = [];
  4564.    }
  4565.    if(!_root.gamePaused)
  4566.    {
  4567.       _root.updateSpeed();
  4568.       _root.thing.update();
  4569.       _root.frame.update();
  4570.       _root.matrixbg.update();
  4571.       _root.whiteBg.update();
  4572.       _root.bossbg.update();
  4573.       var _loc4_ = new Array();
  4574.       for(var _loc6_ in _root.cr)
  4575.       {
  4576.          if(!_root.cr[_loc6_].remove)
  4577.          {
  4578.             _root.cr[_loc6_].update();
  4579.             _loc4_.push(_root.cr[_loc6_]);
  4580.          }
  4581.          else
  4582.          {
  4583.             _root.cr[_loc6_].removeMovieClip();
  4584.          }
  4585.       }
  4586.       _root.cr = _loc4_;
  4587.       var _loc2_ = new Array();
  4588.       for(var _loc5_ in _root.lig)
  4589.       {
  4590.          if(!_root.lig[_loc5_].remove)
  4591.          {
  4592.             _root.lig[_loc5_].update();
  4593.             _loc2_.push(_root.lig[_loc5_]);
  4594.          }
  4595.          else
  4596.          {
  4597.             _root.lig[_loc5_].removeMovieClip();
  4598.          }
  4599.       }
  4600.       _root.lig = _loc2_;
  4601.       var _loc3_ = new Array();
  4602.       for(var _loc7_ in _root.ef)
  4603.       {
  4604.          if(!_root.ef[_loc7_].remove)
  4605.          {
  4606.             _root.ef[_loc7_].update();
  4607.             _loc3_.push(_root.ef[_loc7_]);
  4608.          }
  4609.          else
  4610.          {
  4611.             _root.ef[_loc7_].removeMovieClip();
  4612.          }
  4613.       }
  4614.       _root.ef = _loc3_;
  4615.    }
  4616. };
  4617. main = function()
  4618. {
  4619.    if(_root.bossOneActive)
  4620.    {
  4621.       _root.onEnterFrame = _root.boss1main;
  4622.       return undefined;
  4623.    }
  4624.    if(_root.bossTwoActive)
  4625.    {
  4626.       _root.onEnterFrame = _root.boss1main;
  4627.    }
  4628.    else if(_root.bossThreeActive)
  4629.    {
  4630.       _root.onEnterFrame = _root.boss1main;
  4631.    }
  4632.    else if(_root.bossFourActive)
  4633.    {
  4634.       _root.onEnterFrame = _root.boss1main;
  4635.    }
  4636.    if(_root.cr_queue.length > 0)
  4637.    {
  4638.       _root.cr = _root.cr.concat(_root.cr_queue);
  4639.       _root.cr_queue = [];
  4640.    }
  4641.    if(!_root.gamePaused)
  4642.    {
  4643.       _root.updateSpeed();
  4644.       _root.thing.update();
  4645.       _root.frame.update();
  4646.       _root.matrixbg.update();
  4647.       _root.whiteBg.update();
  4648.       _root.bossbg.update();
  4649.       if(!_root.planesActive)
  4650.       {
  4651.          if(random(100) < _root.spawnCrystalChance)
  4652.          {
  4653.             _root.spawnCrystal(random(3) + 1);
  4654.          }
  4655.          if(_root.spawnCrystalChance > _root.minSpawnCrystalChance)
  4656.          {
  4657.             if(random(3) == 0)
  4658.             {
  4659.                _root.spawnCrystalChance = _root.spawnCrystalChance - 1;
  4660.             }
  4661.          }
  4662.       }
  4663.       if(random(100) < _root.activeFlags)
  4664.       {
  4665.          _root.spawnBomb();
  4666.       }
  4667.       if(!_root.symmetryActive)
  4668.       {
  4669.          if(!_root.planesActive)
  4670.          {
  4671.             if(_root.speedUpFlag)
  4672.             {
  4673.                if(random(_root.speedUpActProb) < 1)
  4674.                {
  4675.                   _root.spawnSpeedUp();
  4676.                }
  4677.             }
  4678.             if(_root.speedDownFlag)
  4679.             {
  4680.                if(random(_root.speedDownActProb) < 1)
  4681.                {
  4682.                   _root.spawnSpeedDown();
  4683.                }
  4684.             }
  4685.             if(_root.lightningFlag)
  4686.             {
  4687.                if(random(_root.lightningActProb) < 1)
  4688.                {
  4689.                   _root.spawnLightning();
  4690.                }
  4691.             }
  4692.             if(_root.superSpawnFlag)
  4693.             {
  4694.                if(random(_root.superSpawnActProb) < 1)
  4695.                {
  4696.                   _root.spawnSuperSpawn();
  4697.                }
  4698.             }
  4699.             if(_root.magnetismFlag)
  4700.             {
  4701.                if(random(_root.magnetismActProb) < 1)
  4702.                {
  4703.                   _root.spawnMagnetism();
  4704.                }
  4705.             }
  4706.             if(_root.netFlag)
  4707.             {
  4708.                if(random(_root.netActProb) < 1)
  4709.                {
  4710.                   _root.spawnNet();
  4711.                }
  4712.             }
  4713.             if(_root.triggerFlag)
  4714.             {
  4715.                if(random(_root.triggerActProb) < 1)
  4716.                {
  4717.                   _root.spawnBombTrigger();
  4718.                }
  4719.             }
  4720.             if(_root.shieldFlag)
  4721.             {
  4722.                if(random(_root.shieldActProb) < 1)
  4723.                {
  4724.                   _root.spawnShield();
  4725.                }
  4726.             }
  4727.             if(_root.superCrystalsFlag)
  4728.             {
  4729.                if(random(_root.superCrystalsActProb) < 1)
  4730.                {
  4731.                   _root.spawnSuperCrystal();
  4732.                }
  4733.             }
  4734.             if(_root.wavyMotionFlag)
  4735.             {
  4736.                if(random(_root.wavyMotionActProb) < 1)
  4737.                {
  4738.                   _root.spawnWaves();
  4739.                }
  4740.             }
  4741.             if(_root.shakyMotionFlag)
  4742.             {
  4743.                if(random(_root.shakyMotionActProb) < 1)
  4744.                {
  4745.                   _root.spawnShakes();
  4746.                }
  4747.             }
  4748.             if(_root.rotationFlag)
  4749.             {
  4750.                if(random(_root.rotationActProb) < 1)
  4751.                {
  4752.                   _root.spawnRotation();
  4753.                }
  4754.             }
  4755.             if(_root.nonUniformDropSpeedFlag)
  4756.             {
  4757.                if(random(_root.nonUniformDropSpeedActProb) < 1)
  4758.                {
  4759.                   _root.spawnDropSpeed();
  4760.                }
  4761.             }
  4762.             if(_root.pacmanFlag)
  4763.             {
  4764.                if(_root.pacmanActive == false)
  4765.                {
  4766.                   if(random(_root.pacmanActProb) < 1)
  4767.                   {
  4768.                      _root.spawnPacman();
  4769.                   }
  4770.                }
  4771.             }
  4772.             if(_root.matrixFlag)
  4773.             {
  4774.                if(_root.matrixActive == false)
  4775.                {
  4776.                   if(random(_root.matrixActProb) < 1)
  4777.                   {
  4778.                      _root.spawnMatrix();
  4779.                   }
  4780.                }
  4781.             }
  4782.             if(_root.tetrisFlag)
  4783.             {
  4784.                if(_root.tetrisActive == false)
  4785.                {
  4786.                   if(random(_root.tetrisActProb) < 1)
  4787.                   {
  4788.                      _root.spawnTetris();
  4789.                   }
  4790.                }
  4791.             }
  4792.             if(_root.symmetryFlag)
  4793.             {
  4794.                if(_root.symmetryActive == false)
  4795.                {
  4796.                   if(random(_root.symmetryActProb) < 1)
  4797.                   {
  4798.                      _root.spawnSymmetry();
  4799.                   }
  4800.                }
  4801.             }
  4802.             if(_root.snakeFlag)
  4803.             {
  4804.                if(_root.snakeActive == false)
  4805.                {
  4806.                   if(random(_root.snakeActProb) < 1)
  4807.                   {
  4808.                      _root.spawnSnake();
  4809.                   }
  4810.                }
  4811.             }
  4812.             if(_root.planesFlag)
  4813.             {
  4814.                if(_root.planesActive == false)
  4815.                {
  4816.                   if(random(_root.planesActProb) < 1)
  4817.                   {
  4818.                      _root.spawnPlanes();
  4819.                   }
  4820.                }
  4821.             }
  4822.             if(_root.robotsFlag)
  4823.             {
  4824.                if(_root.robotsActive == false)
  4825.                {
  4826.                   if(random(_root.robotsActProb) < 1)
  4827.                   {
  4828.                      _root.spawnRobots();
  4829.                   }
  4830.                }
  4831.             }
  4832.             if(_root.tunnelFlag)
  4833.             {
  4834.                if(_root.tunnelActive == false)
  4835.                {
  4836.                   if(random(_root.tunnelActProb) < 1)
  4837.                   {
  4838.                      _root.spawnTunnel();
  4839.                   }
  4840.                }
  4841.             }
  4842.             if(_root.arkanoidFlag)
  4843.             {
  4844.                if(_root.arkanoidActive == false)
  4845.                {
  4846.                   if(random(_root.arkanoidActProb) < 1)
  4847.                   {
  4848.                      _root.spawnArkanoid();
  4849.                   }
  4850.                }
  4851.             }
  4852.          }
  4853.          else
  4854.          {
  4855.             if(random(100) < 1)
  4856.             {
  4857.                _root.spawnFighterPlane();
  4858.             }
  4859.             if(random(200) < 1)
  4860.             {
  4861.                _root.spawnBomberPlane();
  4862.             }
  4863.          }
  4864.       }
  4865.       var _loc2_ = getTimer();
  4866.       if(_root.magnetismActive)
  4867.       {
  4868.          if(_loc2_ - _root.magnetismActiveTime > 10000)
  4869.          {
  4870.             _root.magnetismActive = false;
  4871.             _root.showMagnetism(false);
  4872.          }
  4873.       }
  4874.       if(_root.netActive)
  4875.       {
  4876.          if(_loc2_ - _root.netActiveTime > 10000)
  4877.          {
  4878.             _root.netActive = false;
  4879.             _root.showNet(false);
  4880.          }
  4881.       }
  4882.       if(_root.shieldActive)
  4883.       {
  4884.          if(_loc2_ - _root.shieldActiveTime > 10000)
  4885.          {
  4886.             _root.shieldActive = false;
  4887.             _root.showShield(false);
  4888.          }
  4889.       }
  4890.       if(_root.wavyMotionActive)
  4891.       {
  4892.          if(_loc2_ - _root.wavyMotionTime > 10000)
  4893.          {
  4894.             _root.wavyMotionActive = false;
  4895.          }
  4896.       }
  4897.       if(_root.shakyMotionActive)
  4898.       {
  4899.          if(_loc2_ - _root.shakyMotionTime > 10000)
  4900.          {
  4901.             _root.shakyMotionActive = false;
  4902.          }
  4903.       }
  4904.       if(_root.rotationActive)
  4905.       {
  4906.          if(_loc2_ - _root.rotationTime > 10000)
  4907.          {
  4908.             _root.rotationActive = false;
  4909.          }
  4910.       }
  4911.       if(_root.nonUniformDropSpeedActive)
  4912.       {
  4913.          if(_loc2_ - _root.nonUniformDropSpeedTime > 10000)
  4914.          {
  4915.             _root.nonUniformDropSpeedActive = false;
  4916.          }
  4917.       }
  4918.       if(_root.pacmanActive)
  4919.       {
  4920.          if(_loc2_ - _root.pacmanTime > 15000)
  4921.          {
  4922.             _root.pacmanActive = false;
  4923.             _root.showPacmanAvatar(false);
  4924.          }
  4925.       }
  4926.       if(_root.tetrisActive)
  4927.       {
  4928.          if(_loc2_ - _root.tetrisTime > 15000)
  4929.          {
  4930.             _root.tetrisActive = false;
  4931.          }
  4932.       }
  4933.       if(_root.symmetryActive)
  4934.       {
  4935.          if(_loc2_ - _root.symmetryTime > 15000)
  4936.          {
  4937.             _root.symmetryActive = false;
  4938.          }
  4939.       }
  4940.       if(_root.snakeActive)
  4941.       {
  4942.          if(_loc2_ - _root.snakeTime > 15000)
  4943.          {
  4944.             _root.snakeActive = false;
  4945.             _root.showSnakeAvatar(false);
  4946.          }
  4947.       }
  4948.       if(_root.robotsActive)
  4949.       {
  4950.          if(_loc2_ - _root.robotsTime > 15000)
  4951.          {
  4952.             _root.robotsActive = false;
  4953.          }
  4954.       }
  4955.       if(_root.tunnelActive)
  4956.       {
  4957.          if(_loc2_ - _root.tunnelTime > 30000)
  4958.          {
  4959.             _root.tunnelActive = false;
  4960.             _root.tunnelController.remove = true;
  4961.             _root.showText("Tunnel Bonus:",300,212);
  4962.             _root.showScore(1000,300,230);
  4963.          }
  4964.       }
  4965.       if(_root.arkanoidActive)
  4966.       {
  4967.          if(_loc2_ - _root.arkanoidTime > 30000)
  4968.          {
  4969.             _root.removeArkanoid();
  4970.          }
  4971.       }
  4972.       var _loc5_ = new Array();
  4973.       for(var _loc7_ in _root.cr)
  4974.       {
  4975.          if(!_root.cr[_loc7_].remove)
  4976.          {
  4977.             _root.cr[_loc7_].update();
  4978.             _loc5_.push(_root.cr[_loc7_]);
  4979.          }
  4980.          else
  4981.          {
  4982.             _root.cr[_loc7_].removeMovieClip();
  4983.          }
  4984.       }
  4985.       _root.cr = _loc5_;
  4986.       var _loc3_ = new Array();
  4987.       for(var _loc6_ in _root.lig)
  4988.       {
  4989.          if(!_root.lig[_loc6_].remove)
  4990.          {
  4991.             _root.lig[_loc6_].update();
  4992.             _loc3_.push(_root.lig[_loc6_]);
  4993.          }
  4994.          else
  4995.          {
  4996.             _root.lig[_loc6_].removeMovieClip();
  4997.          }
  4998.       }
  4999.       _root.lig = _loc3_;
  5000.       var _loc4_ = new Array();
  5001.       for(var _loc8_ in _root.ef)
  5002.       {
  5003.          if(!_root.ef[_loc8_].remove)
  5004.          {
  5005.             _root.ef[_loc8_].update();
  5006.             _loc4_.push(_root.ef[_loc8_]);
  5007.          }
  5008.          else
  5009.          {
  5010.             _root.ef[_loc8_].removeMovieClip();
  5011.          }
  5012.       }
  5013.       _root.ef = _loc4_;
  5014.    }
  5015. };
  5016. showInfoBox = function(id, msg)
  5017. {
  5018.    _root.tuteBoxOn = true;
  5019.    _root.aInfo.removeMovieClip();
  5020.    var _loc3_ = _root.createEmptyMovieClip("aInfo",_root.getNextHighestDepth());
  5021.    var _loc4_ = _loc3_.attachMovie("infoBox" + id,"infoBox" + getTimer(),_loc3_.getNextHighestDepth());
  5022.    _loc4_.box.msg.text = msg;
  5023.    _loc3_._alpha = 80;
  5024.    _loc3_._x = 300;
  5025.    _loc3_._y = 225;
  5026.    _loc4_.play();
  5027.    _loc4_.box.continueButton.onRelease = function()
  5028.    {
  5029.       _root.playSFX("pageflip");
  5030.       this._parent._parent.play();
  5031.       _root.tuteBox = _root.tuteBox + 1;
  5032.    };
  5033.    if(id == 0)
  5034.    {
  5035.       _loc4_.box.skipButton.onRelease = function()
  5036.       {
  5037.          this._parent._parent.play();
  5038.          _root.tuteBox = 7;
  5039.       };
  5040.    }
  5041. };
  5042. mainTute1 = function()
  5043. {
  5044.    if(!_root.gamePaused)
  5045.    {
  5046.       _root.updateSpeed();
  5047.       _root.thing.update();
  5048.       _root.frame.update();
  5049.       var _loc3_ = new Array();
  5050.       for(var _loc4_ in _root.ef)
  5051.       {
  5052.          if(!_root.ef[_loc4_].remove)
  5053.          {
  5054.             _root.ef[_loc4_].update();
  5055.             _loc3_.push(_root.ef[_loc4_]);
  5056.          }
  5057.          else
  5058.          {
  5059.             _root.ef[_loc4_].removeMovieClip();
  5060.          }
  5061.       }
  5062.       _root.ef = _loc3_;
  5063.       if(_root.tuteBoxOn == false)
  5064.       {
  5065.          switch(_root.tuteBox)
  5066.          {
  5067.             case 0:
  5068.                _root.showInfoBox(0,"Just a few things you need to know before playing...\n\n1. You control the blue blob that follows the mouse cursor around.");
  5069.                break;
  5070.             case 1:
  5071.                _root.showInfoBox(1,"2. This bar shows how many lives you have left. Preserve them by avoiding collision with dangerous mines (     ).");
  5072.                break;
  5073.             case 2:
  5074.                _root.showInfoBox(2,"3. This is the time you spent playing. The longer you play, the more features and powerups will become unlocked. The game also speeds up slightly over time.");
  5075.                break;
  5076.             case 3:
  5077.                _root.showInfoBox(3,"4. These are your points. You earn them mainly by collecting crystals (   ,   ,   ).\n\nYou get more points for collecting longer series of crystals of the same color.");
  5078.                break;
  5079.             case 4:
  5080.                _root.showInfoBox(4,"5. This is the current game speed. Score is based on speed, so you get more points the faster you go.");
  5081.                break;
  5082.             case 5:
  5083.                _root.showInfoBox(5,"6. Powerups like these (       ,       ,       ) can offer new abilities or alter the game world to create special challenges. Press <SPACEBAR> anytime to bring up the HELP menu and read more about powerups.");
  5084.                break;
  5085.             case 6:
  5086.                _root.showInfoBox(6,"That\'s pretty much it.\n\nTry collecting some crystals while avoiding the mines.\n\nRemember you can press <SPACEBAR> to bring up the menu.");
  5087.                break;
  5088.             case 7:
  5089.                _root.onEnterFrame = main;
  5090.                Key.addListener(_root.keyListener);
  5091.                _root.levelInterval = setInterval(this,"levelUp",60000);
  5092.                _root.clockInterval = setInterval(this,"clock",1000);
  5093.                _root.speedStrInterval = setInterval(this,"updateSpeedStr",100);
  5094.                Mouse.hide();
  5095.          }
  5096.       }
  5097.    }
  5098. };
  5099. mainTute2 = function()
  5100. {
  5101.    if(!_root.gamePaused)
  5102.    {
  5103.       _root.updateSpeed();
  5104.       _root.thing.update();
  5105.       _root.frame.update();
  5106.       var _loc3_ = new Array();
  5107.       for(var _loc4_ in _root.ef)
  5108.       {
  5109.          if(!_root.ef[_loc4_].remove)
  5110.          {
  5111.             _root.ef[_loc4_].update();
  5112.             _loc3_.push(_root.ef[_loc4_]);
  5113.          }
  5114.          else
  5115.          {
  5116.             _root.ef[_loc4_].removeMovieClip();
  5117.          }
  5118.       }
  5119.       _root.ef = _loc3_;
  5120.       if(_root.tuteBoxOn == false)
  5121.       {
  5122.          switch(_root.tuteBox)
  5123.          {
  5124.             case 0:
  5125.                _root.showInfoBox(0,"Welcome to \'free play mode\'\nJust a few things you need to know before playing...\n\n1. You control the blue blob that follows the mouse cursor around.");
  5126.                break;
  5127.             case 1:
  5128.                _root.showInfoBox(1,"2. This bar shows how many lives you have left. Preserve them by avoiding collision with dangerous mines (     ).");
  5129.                break;
  5130.             case 2:
  5131.                _root.showInfoBox(2,"3. This is the time you spent playing. The game speeds up slightly over time.");
  5132.                break;
  5133.             case 3:
  5134.                _root.showInfoBox(3,"4. These are your points. You earn them mainly by collecting crystals (   ,   ,   ). You get more points for collecting longer series of crystals of the same color.\n\nIn free play you won\'t be able to submit your final score.");
  5135.                break;
  5136.             case 4:
  5137.                _root.showInfoBox(4,"5. This is the current game speed. Score is based on speed, so you get more points the faster you go.");
  5138.                break;
  5139.             case 5:
  5140.                _root.showInfoBox(5,"6. Powerups like these (       ,       ,       ) can offer new abilities or alter the game world to create special challenges. In free play mode they\'re all enabled from the beginning!");
  5141.                break;
  5142.             case 6:
  5143.                _root.showInfoBox(6,"That\'s pretty much it.\nHave fun experimenting in free play mode. Try collecting some crystals while avoiding the mines.\n\nRemember you can press <SPACEBAR> to bring up the menu at any time.");
  5144.                break;
  5145.             case 7:
  5146.                _root.onEnterFrame = main;
  5147.                Key.addListener(_root.keyListener);
  5148.                _root.levelInterval = setInterval(this,"levelUp",60000);
  5149.                _root.clockInterval = setInterval(this,"clock",1000);
  5150.                _root.speedStrInterval = setInterval(this,"updateSpeedStr",100);
  5151.                Mouse.hide();
  5152.          }
  5153.       }
  5154.    }
  5155. };
  5156. _root.showLivesGui(true);
  5157. if(_root.freePlayActive)
  5158. {
  5159.    _root.onEnterFrame = mainTute2;
  5160. }
  5161. else
  5162. {
  5163.    _root.disableAllFlags();
  5164.    _root.onEnterFrame = mainTute1;
  5165. }
  5166. thing.update = _root.thingUpdate;
  5167. _root.makePausedScreen();
  5168. _root.showMagnetism(false);
  5169. _root.showNet(false);
  5170. _root.showShield(false);
  5171. _root.showPacmanAvatar(false);
  5172. _root.showSnakeAvatar(false);
  5173. _root.showPlanesAvatar(false);
  5174. _root.showBossBar(false);
  5175. _root.thing.then = getTimer();
  5176. _root.thing.shrink = 0;
  5177. _root.thing.desiredWidth = 16;
  5178. _root.shuffleResetAr();
  5179. _root.playCurrentTrack();
  5180.